Giter Club home page Giter Club logo

events's People

Contributors

colindev avatar

Watchers

 avatar  avatar

events's Issues

重順 connected 觸發時間點

必須符合以下條件

  1. 握手訊息為 client auth
  2. server send connected 必須在頻道註冊完成之後
  • client Conn.Auth -> hub.auth
  • client conn pool 的 auth 行為

單元測試: client conn

read

  • conn.readLine

  • conn.readLen

  • conn.Receive

    • Reply
    • Err
    • Pong
    • Event

write

  • conn.writeLen

  • conn.writeEvent

  • conn.Auth

  • conn.Recover

  • conn.RecoverSince

  • conn.Subsceibe

  • conn.Unsubscribe

  • conn.Fire

  • conn.Ping

Tool: eventd

  • 支援 fire flag
  • 支援 recover flag
  • 支援 auth / ghost connect

處理 recover 時 多線程訊息順序異常問題

狀況說明

當斷線的 client 重新連上時且初始化偵聽頻到當下,會立刻收到當前的最新訊息
之後的 recover 命令無法改變前面已收到的訊息順序

作法

連線一段時間內替換 write buffer
等收到recover 請求後寫完再換回去

問題

具名連線時會造成訊息延遲感

評估

過往資料流與當前活躍資料在某個程度上並沒有相依關係

壓力測試

  • 評估每秒可以收幾個簡單事件
  • 100 個 listener 分別註冊 10 個頻道, 10 個 發送端 每秒一個 1mb 訊息

單元測試: server conn

  • Conn.EachChannels
  • Conn.Subscribe
  • Conn.Unsubscribe
  • Conn.IsListening
  • Conn.Readline
  • Conn.writeLen
  • Conn.writeEvent
  • Conn.writePong
  • Conn.writeReply
  • Conn.writeError

單元測試 server hub

  • Hub.auth
  • Hub.quit
  • Hub.quitAll
  • Hub.publish
  • Hub.recover
  • Hub.publish / Hub.recover with concurrency

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.