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 a 'collect(until:)' operator #92

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ferologics
Copy link

Useful for collecting elements when there the element count is unknown or does not fit any time grouping strategy.

@freak4pc
Copy link
Member

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:

  1. Find a way to compose other operators to make this work; or
  2. Build a custom publisher (similar to others in this repo) to be the consumer for the events and the trigger

@freak4pc
Copy link
Member

Hey @ferologics, do you still want to pursue this operator?

@ferologics
Copy link
Author

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 🙂

@ferologics ferologics marked this pull request as draft November 1, 2021 09:07
@ferologics
Copy link
Author

ferologics commented Nov 1, 2021

@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 🙌

@ferologics ferologics marked this pull request as ready for review November 24, 2021 11:05
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

Successfully merging this pull request may close these issues.

None yet

2 participants