netty websocket + continuous PERIODIC data push -
what best way continuously push data periodically(say every n seconds) websocket server in netty?
edit :
i came across post : best way send continuous data in java using netty , according answer,while/sleep wouldnt scalable, how 1 schedule job on executor ?
- websocket client connects netty server, handshakes , establishes websocket connection.
- the server registers client's channel somewhere can retrieved when there's data send. (i use channelgroup in singleton)
- the scheduled job fires, gets data somewhere, gets reference client's channel , writes data it.
- the client channel's pipeline should have few encoders in marshal scheduled job supplied data websocket frames.
Comments
Post a Comment