-
Notifications
You must be signed in to change notification settings - Fork 42
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
Overflow mode #44
Comments
I also have a use case where I want an async SPSC bounded channel that follows the overflow method of I can use |
This should be possible to do after adding a function similar to crossbeam-rs/crossbeam@bd75c3c to concurrent-queue. |
In some cases it is desired to have a "lossy" queue for data. Such as an event queue where more recent events should be prioritized over older ones, where infinite storage is impractical. This commit adds a method called "force_push" which enables this usage. Bounded queue code is partially derived from the following commit: crossbeam-rs/crossbeam@bd75c3c cc smol-rs/async-channel#44 Signed-off-by: John Nunley <dev@notgull.net>
In some cases it is desired to have a "lossy" queue for data. Such as an event queue where more recent events should be prioritized over older ones, where infinite storage is impractical. This commit adds a method called "force_push" which enables this usage. Bounded queue code is partially derived from the following commit: crossbeam-rs/crossbeam@bd75c3c cc smol-rs/async-channel#44
This function has been added to |
Closes #44 by adding a "force_send" method. This method can replace an existing element in the list, in which case that element is returned. This can be used to make "limited capacity" channels. Signed-off-by: John Nunley <dev@notgull.net>
Closes #44 by adding a "force_send" method. This method can replace an existing element in the list, in which case that element is returned. This can be used to make "limited capacity" channels. Signed-off-by: John Nunley <dev@notgull.net>
Would it be possible to have overflow mode (similar to one in async_broadcast) in this implementation? Would be nice to have this mode for a channel that doesn't require Clone for messages.
The text was updated successfully, but these errors were encountered: