feat(sdk): Add content delivery layer buffer configurations - #3305
Merged
juslesan merged 15 commits intoDec 17, 2025
Merged
Conversation
teogeb
approved these changes
Dec 17, 2025
juslesan
deleted the
add-buffer-configurations-required-by-streamr-tv
branch
December 17, 2025 14:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
There are two different buffers related to this PR. The propagation buffer and connection buffers. The propagation buffer is used when a node is broadcasting data but does not have neighbors to send the data to. The connection buffer is used when a new connection is formed in the network.
Summary
We can now configure these two options for the content delivery layer:
streamPartitionMaxPropagationBufferSizecan be used to set the size of the propagation buffer.contentDeliveryBufferWhileConnectingcan be used to stop buffering while a connection is being formed.Related changes
doNotBufferWhileConnectingtobufferWhileConnectingin thetrackerless-networkanddhtpackages.Example use case
In a case where a publisher joins the network before subscribers the publisher stores the data to a buffer as it cannot send it to anyone. When a subscriber joins the content of the buffer is sent to the subscriber first and after that the real-time data is sent. If we don't want that the buffer content is sent then we can use set
streamPartitionMaxBufferSizeto 0 to avoid propagation buffering.Additionally if the opening of connections takes long it is possible to disable buffering on connecting connections to avoid sending of old messages by setting the
contentDeliveryBufferWhileConnectingas false.