If the channel is bounded and full, the new value will be forcefully pushed onto the channel and the oldest value that hasn't been received yet will be returned in the Option<T>. If the channel isn't full, then None is returned.
For context, I posted a Reddit thread to ask the community for help/advice for what library to use for this functionality. Although, from my research, it seems like Flume would be a great candidate to directly add this functionality to because it has all of the other features I need! đ
I'm going to start learning about Flume's code base so I can start formulating a PR.
Flume has:
flume::Sender::send
: block until space is availableflume::Sender::send_async
: block until space is available (but async)flume::Sender::try_send
: attempt to send, fail otherwiseI propose adding a new function that implements "lossy ring buffer" functionality:
If the channel is bounded and full, the new value will be forcefully pushed onto the channel and the oldest value that hasn't been received yet will be returned in the
Option<T>
. If the channel isn't full, thenNone
is returned.For context, I posted a Reddit thread to ask the community for help/advice for what library to use for this functionality. Although, from my research, it seems like Flume would be a great candidate to directly add this functionality to because it has all of the other features I need! đ
I'm going to start learning about Flume's code base so I can start formulating a PR.