CombineExt
CombineExt copied to clipboard
🆕 Add a 'collect(until:)' operator
Useful for collecting elements when there the element count is unknown or does not fit any time grouping strategy.
Hey @ferologics,
Thanks for the suggestion! I think it's a great idea but there are a few issues with the implementation.
Specifically, it is preferable that an operator doesn't use sink
internally. Both because it's not a best practice, and because it automatically forces unlimited back pressure demand.
It seems to me it would be more appropriate to either:
- Find a way to compose other operators to make this work; or
- Build a custom publisher (similar to others in this repo) to be the consumer for the events and the trigger
Hey @ferologics, do you still want to pursue this operator?
Hey @freak4pc, yes! Thank you for the thoughtful response. AFAIK this will require a custom publisher implementation. I will take a look at the implementation of other publishers in the repo and update the code accordingly 🙂
@freak4pc I updated the PR with alternative implementation that avoids the sink
on upstream. I haven't thought of a way to avoid the sink
on trigger. Let me know if this is correct 🙌