Skip to content

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

@filipdulic

Description

@filipdulic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions