-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Stateless conflated Broadcast channel #1756
Comments
Have you tried using |
Yep, it doesn't preserve a state but it suspends send function while buffer is full. So I get a queue of stale events if my emitter too fast or consumer too slow. Closest examples to a thing I'm looking for are PublishProcessor and LiveEvent. Edit |
@orwir You can get it now with However, I'm a bit lost in your specific use-case. You originally said that you are looking for a mechanism to handle "events like button clicks and some notifications relevant only in a small time frame" and it looks like |
@elizarov It' seems I just misunderstood how I can work with channels. And as for conception here. Let's say I need to create to event buses. One if for important event which shouldn't be lost at all and here I'll use |
I'm trying to create events handling based on coroutines (
ConflatedBroadcastChannel
specifically) but faced an issue that currently it is not possible to have stateless broadcast channel. Events like button clicks and some notifications relevant only in a small time frame (just when they appeared) and preserving state in the "event bus" leads to unexpected behavior. So question is can we have "stateless flag" inConflatedBroadcastChannel
or probably new class to deal with it?I created small class and it works fine, but might be better to have it natively.
The text was updated successfully, but these errors were encountered: