futures-buffered icon indicating copy to clipboard operation
futures-buffered copied to clipboard

Keyed variant of `MergeUnbounded` feasable?

Open Frando opened this issue 1 year ago • 1 comments

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.

Frando avatar Aug 01 '24 10:08 Frando

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

conradludgate avatar Aug 01 '24 11:08 conradludgate