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

Keyed variant of MergeUnbounded feasable? #6

Open
Frando opened this issue Aug 1, 2024 · 1 comment
Open

Keyed variant of MergeUnbounded feasable? #6

Frando opened this issue Aug 1, 2024 · 1 comment

Comments

@Frando
Copy link
Contributor

Frando commented Aug 1, 2024

Hi,
we know have MergeUnbounded to merge an unbounded, growable list of streams. However it is not possible to remove streams from the list. futures_concurrency has a Keyed variant, where insert (push in MergeUnbounded) returns a Key that can be kept and passed to remove to remove streams from the group/merge. MergeUnbounded has much better performance than StreamGroup though, especially for large numbers of streams.

Is a Keyed variant of MergeUnbounded feasable? As removal is usually not a very frequent operation (in comparison to polling for the next item), I think it'd be fine for this to involve some iteration.

@conradludgate
Copy link
Owner

Yeah I think it is! I've thought about it prior and it should be possible using the same generational slotkey idea as slotmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants