Closed Andrey36652 closed 7 months ago
There is no immediate intention to support context_take_over.
context_take_over was designed to be too confusing and inelegant to implement. Supporting context_take_over also introduces additional memory overhead, which breaks the way gws manages compressors/decompressors. And I don't think it's very effective at saving traffic, try protobuffer?
While context_take_over makes more sense for client-side compatibility, gws is focused on high-performance servers, and I didn't want to implement an ugly context_take_over for clients.
try protobuffer?
As I said I receive data from third party server. It sends data as JSON. I have no control there
context_take_over was designed to be too confusing and inelegant to implement
What are possible obstacles while implementing it? Keep in mind I'm talking exclusively about client-side decompression with context takeover.
It's not hard to just provide context_take_over support to the client, but I'll explore that when I have time.
The server has to consider the management of multiple compressors, but the client has only one, and does not need to consider the memory pool.
Thanks. Sadly their server does not support context takeover :( I wanted to benchmark it using python websocket library and found it out.
gws supports context-takeover now
Thank you very much
gws v1.8.0 released, server/client fully support context takeover
https://lxzan.github.io/gws/reports/servers/ https://lxzan.github.io/gws/reports/clients/
My usecase includes many similar messages (150-400 bytes each) sent from third party server. I suppose required bandwidth can be decreased by using server context takeover (as a client). Currently as I can see in code https://github.com/lxzan/gws/blob/5318d69e5cc8140f33197fcb328f565e66043e2d/client.go#L135 https://github.com/lxzan/gws/blob/5318d69e5cc8140f33197fcb328f565e66043e2d/internal/others.go#L18 extension "server_no_context_takeover" is hardcoded. Is there any way to modify library for using server context takeover? Or is it too much hassle?