Tao Release Notes

Tao 1.7.0 TODOs:
. HashedWheelTImer
. 使用反射改進Handler設計
. read about teleport
. Tao - Go語言實現的TCP網絡編程框架 英文翻譯
. BufferSizeOption改為ChannelSizeOption
. 定時器重構
TimedTask要帶上net id作為context,把這個接口封裝好

Annoucing Tao 1.6.0

  1. Bugfix: writeLoop() drains all pending messages before exit;
    writeLoop()函數退出前將所有的網絡數據包發送完畢;
  2. Renaming getter methods according to Effective Go;
    根據Effective Go重命名getter方法;
  3. Bugfix: timer task expired forever due to system clock affected by NTP;
    修復因為受NTP協議校正系統時鐘偏差的影響,導致定時任務永遠過期的bug;
  4. Bugfix: asyncWrite() do not return error if called after ServerConn or ClientConn closes;
    修復網絡連接關閉后調用asyncWrite()不返回錯誤的bug;
  5. Providing WorkerSizeOption() for tuning the size of worker go-routine pool;
    提供WorkerSizeOption()來調節工作者線程池大小;
  6. Providing BufferSizeOption() for tuning the size of buffered channel;
    提供BufferSizeOption()來調節緩沖通道大??;
  7. Providing ReconnectOption() for activating ClientConn's reconnecting mechanism;
    提供ReconnectOption()來啟動ClientConn的斷線重連機制;
  8. Providing CustomCodecOption() for setting self-defined codec;
    提供CustomCodecOption() 來設置自定義編解碼器;
  9. Providing TLSCredsOption() for running a TLS server;
    提供TLSCredsOption()來運行TLS服務器;
  10. Providing OnConnectOption(), OnMessageOption(), OnCloseOption() and OnErrorOption() for setting callbacks of the four situations respectively;
    提供OnConnectOption(), OnMessageOption(), OnCloseOption() 和 OnErrorOption()來設置四種情況下的回調函數;
  11. Use the standard sync.Map instead of map guarded by rwmutex;
    使用標準庫中的sync.Map替換使用rwmutex保護的map;

Anncoucing Tao 1.5.0

  1. A Golang-style redesigning of the overall framework, a reduce about 500+ lines of codes;
    按照Go語言風格重新設計的整體框架,精簡500多行代碼;
  2. Providing new Server, ClientConn and ServerConn struct and a WriteCloser interface;
    提供Server,ClientConn和ServerConn三種新結構和WriteCloser新接口;
  3. Using standard context package to manage and spread request-scoped data acrossing go-routines;
    使用標準庫中的context包在多個Go線程中管理和傳播與請求有關的數據;
  4. Graceful stopping, all go-routines are related by context, and they will be noticed and exit when server stops or connection closes;
    優雅停機,所有的Go線程都通過上下文進行關聯,當服務器停機或連接關閉時它們都會收到通知并執行退出;
  5. Providing new type HandlerFunc func(context.Context, WriteCloser) for defining message handlers;
    提供新的HandlerFunc類型來定義消息處理器;
  6. 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()函數來在上下文中存取他們將在處理器函數中使用的消息,這樣的設計更簡潔;
  7. 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服務,修復了多個“通道阻塞”的死鎖問題;
  8. Reconnecting mechanism of ClientConn is redesigned and optimized;
    重新設計和優化ClientConn的斷線重連機制;

Announcing Tao 1.4.0

  1. bugfix:TLS重連失敗問題;
    bugfix: failed to reconnect the TLS connection;
  2. bugfix:ConnectionMap死鎖問題;
    bugfix: ConnectionMap dead-lock problem;
  3. 優化TCP網絡連接的關閉過程;
    Optimize the closing process of TCP connection;
  4. 優化服務器的關閉過程;
    Optimize the closing process of server;
  5. 更優雅的消息處理注冊接口;
    More elegant message handler register interface;

Announcing Tao 1.3.0

  1. bugfix:修復斷線重連狀態不一致問題;
    bugfix: fixed inconsistent status caused by reconnecting;
  2. bugfix:修復ServerConnection和TimingWheel在連接關閉時并發訪問導致崩潰問題;
    bugfix: fixed a corruption caused by concurrent accessing between ServerConnection and TimingWheel during connection closing;
  3. 無鎖且線程安全的TimingWheel,優化CPU占用率;
    Lock-free and thread-safe TimingWheel, optimized occupancy rate;
  4. bugfix:修復TLS配置文件讀取函數;
    bugfix: Fixed errors when loading TLS config;
  5. 添加消息相關的Context結構;簡化消息注冊機制,直接注冊處理函數到HandlerMap;
    A message-related Context struct added; Register handler functions in HandlerMap directly to simplify message registration mechanism;
  6. 合并NewClientConnection()和NewTLSClientConnection(),提供一致的API;
    Combine NewTLSConnection() into NewClientConnection(), providing a consistent API;
  7. 工作者線程池改造成單例模式;
    Make WorkerPool a singleton pattern;
  8. 使用Holmes日志庫代替glog;
    Using Holmes logging package instead of glog;
  9. 添加metrics.go:基于expvar標準包導出服務器關鍵信息;
    Add metrics.go: exporting critical server information based on expvar standard pacakge;

Announcing Tao 1.2.0

  1. 更優雅的消息注冊接口;
    More elegant message register interface;
  2. TCPConnection的斷線重連機制;
    TCPConnection reconnecting upon closing;
  3. bugfix:協議未注冊時不關閉客戶端連接;
    bugfix: Don't close client when messages not registered;
  4. bugfix:在readLoop()協程中處理心跳時間戳更新;
    bugfix: Updating heart-beat timestamp in readLoop() go-routine;
  5. 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;
  6. bugfix:當應用層數據長度大于0時才對其進行序列化;
    bugfix: Serialize application data when its length greater than 0;
  7. 新API:SetCodec(),允許TCPConnection自定義編解碼器;
    New API: SetCodec() allowing TCPConnection defines its own codec;
  8. 新API:SetDBInitializer(),允許框架使用者定義數據訪問接口;
    New API: SetDBInitializer() allowing framework users define data access interface;
  9. 允許框架使用者在TCPConnection上設置自定義數據;
    Allowing framework users setting custom data on TCPConnection;
  10. 為新客戶端連接的啟動單獨開辟一個對應的go協程;
    Allocating a corresponding go-routine for newly-connected clients respectively;
  11. bugfix:寫事件循環在連接關閉時將信道中的數據全部發送出去;
    bugfix: writeLoop() flushes all packets left in channel when performing closing;
  12. bugfix:服務器和客戶端連接等待所有go協程關閉后再退出;
    bugfix: Servers and client connections wait for the exits of all go-routines before shutting down;
  13. 重構Server和Connection,采用針對接口編程的設計;
    Refactoring Server and Connection, adopting a programming-by-interface design;
  14. 設置500毫秒讀超時,防止readLoop()發生阻塞;
    Setting 500ms read-timeout prevents readLoop() from blocking;

Annoucing Tao 1.1.0

  1. 添加注釋,提高代碼可讀性
    Add comments, make it more readable;
  2. 服務器的最大并發連接數(默認1000)
    Server max connections limit (default to 1000);
  3. 新API:TCPServer:NewTLSTCPServer() 創建傳輸層安全的TCP服務器
    New API: NewTLSTCPServer() for creating TLS-supported TCP server;
  4. 新特性:TCPServer:SetOnScheduleCallback() 由框架使用者來定義計劃任務(比如心跳)
    Make scheduled task managed by framwork users;
  5. 新特性:支持默認的消息編解碼器TypeLengthValueCodec,并允許框架使用者開發自定義編解碼器
    Support TypeLengthValueCodec by default, allow framework users develop their own codecs;
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,948評論 18 139
  • 他眼神深邃,下完命令也沒看其它人一眼,只定定的看著她。 無憂不著痕跡退了一步,期間,那脊背挺得筆直,宛如孔雀,驕傲...
    陌黎淺淺閱讀 3,751評論 0 0
  • 在新媒體快速發展的時代,很多像我一樣對新媒體感興趣或者所學專業偏向互聯網的實習生都將求職目光投向了各大公司的新媒體...
    馬爾她閱讀 970評論 0 4
  • 網上有種論調很流行,讓父母要接受并鼓勵孩子成為幸福的“普通人”。并不是每個孩子最終都能成龍成鳳,而普通人有普通人的...
    Miya小桶閱讀 602評論 3 1
  • 一、蘇可剛到雜志社,就被主編召去開會。 會議的主題,是商議下個月七夕??膶懽鞣桨?。 大家七嘴八舌討論了一通,主編...
    十三明月閱讀 535評論 5 7