I'd like to raise a discussion related to WS duplex implementation
Currently duplex is implemented having 2 tasks sharing connection, common resources (Spsc queue etc):
But internally we know for sure that they operate on the same socket, which just don't give up the control flow.
The proposal aims to simplify the client's code:
only 1 task is required now
-- we don't have to use a queue or other sync primitives to handle data between tasks
-- actually in userver connections RST/FIN are imlemented via IoException propagate. The 2-task scenario requires 2 different exceptions to handle on the came scenario, what makes a service imlementation to be more complex
-- lesser allocations count
I'd like to raise a discussion related to WS duplex implementation Currently duplex is implemented having 2 tasks sharing connection, common resources (Spsc queue etc):
https://github.com/userver-framework/userver/blob/0762adcd2fa9c33aad71945c6469eac3ec22d625/core/functional_tests/websocket/service.cpp#L65-L89
But internally we know for sure that they operate on the same socket, which just don't give up the control flow.
The proposal aims to simplify the client's code: