Tao 1.7.0 TODOs:
. HashedWheelTImer
. 使用反射改进Handler设计
. read about teleport
. Tao - Go语言实现的TCP网络编程框架 英文翻译
. BufferSizeOption改为ChannelSizeOption
. 定时器重构
TimedTask要带上net id作为context,把这个接口封装好
Annoucing Tao 1.6.0
- Bugfix: writeLoop() drains all pending messages before exit;
writeLoop()函数退出前将所有的网络数据包发送完毕; - Renaming getter methods according to Effective Go;
根据Effective Go重命名getter方法; - Bugfix: timer task expired forever due to system clock affected by NTP;
修复因为受NTP协议校正系统时钟偏差的影响,导致定时任务永远过期的bug; - Bugfix: asyncWrite() do not return error if called after ServerConn or ClientConn closes;
修复网络连接关闭后调用asyncWrite()不返回错误的bug; - Providing WorkerSizeOption() for tuning the size of worker go-routine pool;
提供WorkerSizeOption()来调节工作者线程池大小; - Providing BufferSizeOption() for tuning the size of buffered channel;
提供BufferSizeOption()来调节缓冲通道大小; - Providing ReconnectOption() for activating ClientConn's reconnecting mechanism;
提供ReconnectOption()来启动ClientConn的断线重连机制; - Providing CustomCodecOption() for setting self-defined codec;
提供CustomCodecOption() 来设置自定义编解码器; - Providing TLSCredsOption() for running a TLS server;
提供TLSCredsOption()来运行TLS服务器; - Providing OnConnectOption(), OnMessageOption(), OnCloseOption() and OnErrorOption() for setting callbacks of the four situations respectively;
提供OnConnectOption(), OnMessageOption(), OnCloseOption() 和 OnErrorOption()来设置四种情况下的回调函数; - Use the standard sync.Map instead of map guarded by rwmutex;
使用标准库中的sync.Map替换使用rwmutex保护的map;
Anncoucing Tao 1.5.0
- A Golang-style redesigning of the overall framework, a reduce about 500+ lines of codes;
按照Go语言风格重新设计的整体框架,精简500多行代码; - Providing new Server, ClientConn and ServerConn struct and a WriteCloser interface;
提供Server,ClientConn和ServerConn三种新结构和WriteCloser新接口; - Using standard context package to manage and spread request-scoped data acrossing go-routines;
使用标准库中的context包在多个Go线程中管理和传播与请求有关的数据; - Graceful stopping, all go-routines are related by context, and they will be noticed and exit when server stops or connection closes;
优雅停机,所有的Go线程都通过上下文进行关联,当服务器停机或连接关闭时它们都会收到通知并执行退出; - Providing new type HandlerFunc func(context.Context, WriteCloser) for defining message handlers;
提供新的HandlerFunc类型来定义消息处理器; - Developers can now use NewContextWithMessage() and MessageFromContext() to put and get message they are about to use in handler function's context, this also leads to a more clarified design;
开发者现在可以通过NewContextWithMessage()和MessageFromContext()函数来在上下文中存取他们将在处理器函数中使用的消息,这样的设计更简洁; - Go-routine functions readLoop(), writeLoop() and handleLoop() are all optimized to serve both ServerConn and ClientConn, serveral dead-lock bugs such as blocking on channels are fixed;
优化Go线程函数readLoop(),writeLoop()和handleLoop()使得它们能同时为ServerConn和ClientConn服务,修复了多个“通道阻塞”的死锁问题; - Reconnecting mechanism of ClientConn is redesigned and optimized;
重新设计和优化ClientConn的断线重连机制;
Announcing Tao 1.4.0
- bugfix:TLS重连失败问题;
bugfix: failed to reconnect the TLS connection; - bugfix:ConnectionMap死锁问题;
bugfix: ConnectionMap dead-lock problem; - 优化TCP网络连接的关闭过程;
Optimize the closing process of TCP connection; - 优化服务器的关闭过程;
Optimize the closing process of server; - 更优雅的消息处理注册接口;
More elegant message handler register interface;
Announcing Tao 1.3.0
- bugfix:修复断线重连状态不一致问题;
bugfix: fixed inconsistent status caused by reconnecting; - bugfix:修复ServerConnection和TimingWheel在连接关闭时并发访问导致崩溃问题;
bugfix: fixed a corruption caused by concurrent accessing between ServerConnection and TimingWheel during connection closing; - 无锁且线程安全的TimingWheel,优化CPU占用率;
Lock-free and thread-safe TimingWheel, optimized occupancy rate; - bugfix:修复TLS配置文件读取函数;
bugfix: Fixed errors when loading TLS config; - 添加消息相关的Context结构;简化消息注册机制,直接注册处理函数到HandlerMap;
A message-related Context struct added; Register handler functions in HandlerMap directly to simplify message registration mechanism; - 合并NewClientConnection()和NewTLSClientConnection(),提供一致的API;
Combine NewTLSConnection() into NewClientConnection(), providing a consistent API; - 工作者线程池改造成单例模式;
Make WorkerPool a singleton pattern; - 使用Holmes日志库代替glog;
Using Holmes logging package instead of glog; - 添加metrics.go:基于expvar标准包导出服务器关键信息;
Add metrics.go: exporting critical server information based on expvar standard pacakge;
Announcing Tao 1.2.0
- 更优雅的消息注册接口;
More elegant message register interface; - TCPConnection的断线重连机制;
TCPConnection reconnecting upon closing; - bugfix:协议未注册时不关闭客户端连接;
bugfix: Don't close client when messages not registered; - bugfix:在readLoop()协程中处理心跳时间戳更新;
bugfix: Updating heart-beat timestamp in readLoop() go-routine; - bugfix:Message接口使用Serialize()替代之前的MarshalBinary(),以免框架使用者使用gob.Encoder/Decoder的时候栈溢出;
bugfix: Use Serialize() instead of MarshalBinary() in Message interface, preventing stack overflows when framework users use gob.Encoder/Decoder; - bugfix:当应用层数据长度大于0时才对其进行序列化;
bugfix: Serialize application data when its length greater than 0; - 新API:SetCodec(),允许TCPConnection自定义编解码器;
New API: SetCodec() allowing TCPConnection defines its own codec; - 新API:SetDBInitializer(),允许框架使用者定义数据访问接口;
New API: SetDBInitializer() allowing framework users define data access interface; - 允许框架使用者在TCPConnection上设置自定义数据;
Allowing framework users setting custom data on TCPConnection; - 为新客户端连接的启动单独开辟一个对应的go协程;
Allocating a corresponding go-routine for newly-connected clients respectively; - bugfix:写事件循环在连接关闭时将信道中的数据全部发送出去;
bugfix: writeLoop() flushes all packets left in channel when performing closing; - bugfix:服务器和客户端连接等待所有go协程关闭后再退出;
bugfix: Servers and client connections wait for the exits of all go-routines before shutting down; - 重构Server和Connection,采用针对接口编程的设计;
Refactoring Server and Connection, adopting a programming-by-interface design; - 设置500毫秒读超时,防止readLoop()发生阻塞;
Setting 500ms read-timeout prevents readLoop() from blocking;
Annoucing Tao 1.1.0
- 添加注释,提高代码可读性
Add comments, make it more readable; - 服务器的最大并发连接数(默认1000)
Server max connections limit (default to 1000); - 新API:TCPServer:NewTLSTCPServer() 创建传输层安全的TCP服务器
New API: NewTLSTCPServer() for creating TLS-supported TCP server; - 新特性:TCPServer:SetOnScheduleCallback() 由框架使用者来定义计划任务(比如心跳)
Make scheduled task managed by framwork users; - 新特性:支持默认的消息编解码器TypeLengthValueCodec,并允许框架使用者开发自定义编解码器
Support TypeLengthValueCodec by default, allow framework users develop their own codecs;
网友评论