Open plule opened 4 months ago
Have you looked at the non-live variants of the readers? It allows you to perform reads without blocking and just returns an option. Otherwise I would have to look into this, but that would probably be after 0.5 release.
I'll take a look and give a shot to implement it from the non-live one
Might go back on this, at least providing something like 'try_next' or something like that. Reopening to keep it in sight.
When working without an async runtime it can be a bit awkward to manage the blocking calls of the live readers. I think that the standard library channel Receiver do it really well:
.iter()
provides the blocking API, exactly like the current live readers.try_iter()
provides an iterator that is non blocking and ends as soon as there is no more eventsAnd the great thing is that you can use both as needed. As a result, this creates easy constructions to do things like watching just new events:
They also provide the method
recv_timeout()
which is super helpful.