Unidirectional transports and emulation improvements #941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Optimizations for unidirectional transports:
uni_sse
– possibility to write many messages to underlying HTTP connection buffer beforeFlush
. Thus inheriting Centrifugo client protocol message batching possibilitites. Means less syscalls => better CPU usage.uni_http_stream
- same thing as foruni_sse
uni_websocket
- new boolean optionuni_websocket.join_push_messages
, once enabled it allows joining messages to one websocket frame. It's a separate option foruni_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 onceuni_websocket.join_push_messages
is enabledConnectRequest
object is used nowEnabler 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
andsse
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