-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocket algebra #964
base: master
Are you sure you want to change the base?
WebSocket algebra #964
Conversation
Since browser clients cannot interact with upgrade response/request, I though it would be best to explicitly separate Only @julienrf What do you think? |
): WebSocketWithUpgrade[In, Out] | ||
} | ||
|
||
trait WebsocketClientStream { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mean request stream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terms such as request and response are not really used for anything but the upgrade in WebSocket docs that I have read, but there is a clear definition of client and server, so I thought I would use those terms.
After doing more research and thinking, I do not think that a stream is a correct abstraction to express data flowing through a WebSocket. Issue with streams is that they have a definition of an end, and WebSockets lack that - neither client nor server can communicate they either of them have stopped sending their messages, they can only close the connection. Inability to explicitly communicate these clearly separate behaviors puts a limit to the available expression and requires developers to come up with their own protocols. This makes WebSockets not as valuable as I thought before, and they are not a replacement for |
References #954.