Replies: 1 comment
-
the object can be different on each callback in the current implementation (this will change) today we can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think we can use this library to create a websocket server very easily. However, there was a question about maintaining the state, so make this issue: How to make websocket stateful?
on the websockets library, we can simply using
while
loop, we can make websocket stateful. Therefore, we can continue to keep the previous data and get new data.However, In socketify, only accepts by
event handler
, so it seems that we cannot keep the previous data (because afterws_message
event handler was end, and after nextws_message
handler there are no way to identify which is previous data)Even if we check
ws
, which is the only object transmitted, it seems that the ws object ofws_open
andws_message
object are different and are not stateful.So, how can I make socketify websocket server stateful?
Here are some sample ws server using socketify:
Comparison with websockets:
Beta Was this translation helpful? Give feedback.
All reactions