8000 Unidirectional transports and emulation improvements by FZambia · Pull Request #941 · centrifugal/centrifugo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Unidirectional transports and emulation improvements #941

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

Merged
merged 2 commits into from
Feb 15, 2025

Conversation

FZambia
Copy link
Member
@FZambia FZambia commented Feb 14, 2025

Proposed changes

Optimizations for unidirectional transports:

  • uni_sse – possibility to write many messages to underlying HTTP connection buffer before Flush. Thus inheriting Centrifugo client protocol message batching possibilitites. Means less syscalls => better CPU usage.
  • uni_http_stream - same thing as for uni_sse
  • uni_websocket - new boolean option uni_websocket.join_push_messages, once enabled it allows joining messages to one websocket frame. It's a separate option for uni_websocket because in this case client side must be ready to decode frame to separate messages. Messages flow in Centrifugal client protocol format (for JSON – new-line delimited). I.e. basically we do the same a AD5F s we do in bidirectional websocket once uni_websocket.join_push_messages is enabled
  • less allocations on unidirectional connect stage because no intermediary ConnectRequest object is used now

Enabler for delta encoding in unidirectional transports

It's now technically becoming possible to use Fossil delta encoding for messages in unidirectional transport channels. When client sends a hint to server in subs object. Though I am not sure we will promote this possibility a lot right now, just removing technical limitation for now.

Optimizations for emulation

  • http_stream and sse transports used in bidirectional emulation got the same improvements regarding connection buffer writes as described above for unidirectional transports.
  • emulation endpoint now uses faster JSON decoding for incoming requests

@FZambia FZambia merged commit 17f82bd into master Feb 15, 2025
4 checks passed
@FZambia FZambia deleted the unidirectional_improvements branch February 15, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0