Channel that doesn't remove the oldest messages when receiver buffer is full #73
Labels
part:channels
Affects channels implementation
resolution:duplicate
This issue or pull request already exists
type:enhancement
New feature or enhancement visitble to users
What's needed?
Now when receiver buffer size is full and new message comes, then the oldest message is removed.
But in some cases it is important that each request is received and processed.
One such use-case is when we request to subscribe for metric data.
If we have many components/metrics and we subscribe for all data at the startup, then default receiver buffer size is not enough. The oldest messages are removed and the application doesn't work properly because we don't receive data.
Proposed solution
There are two possible solutions:
We could have special kind of blocking channel.
If sender tries to send message, but the receiver buffer size is full, then we should block sender until the receiver buffer size has free space. For implementation simplicity it is enough if channel have many senders and only one receiver. (this covers our all current use-cases)
We could have option to dynamically increase the buffer size - but in that case there might be more and more requests, and receiver is unable to process them in time and the memory might increase too much.
Use cases
For now the only use-case was subscribing for the component metric data.
Alternatives and workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: