Skip to content
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

Add special version of channel where only one SwapSlot is used. #49

Open
filipdulic opened this issue May 10, 2020 · 0 comments
Open

Add special version of channel where only one SwapSlot is used. #49

filipdulic opened this issue May 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@filipdulic
Copy link
Owner

Implement a special version of Channel that uses a single SwapSlot for it's buffer. This is a special case where the Receivers always want the latest data when an item is dropped.

While there would be a performance increase for this specialized use case, as he try_recv method would be much simpler, there would be a penalty in that more items would be dropped, because the Sender will overwrite the old one on every broadcast call.

This should only be used in systems where even the smallest performance benefits outweigh potential loss of data. For all other use cases a much more stable option would be to use a buffer of size, and set the skip_items Receiver field to size - 1.

@filipdulic filipdulic added the enhancement New feature or request label May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant