-
-
Notifications
You must be signed in to change notification settings - Fork 408
Open
Labels
Description
For some reason, sled::Subscriber implements Iterator and Future - a strange combination.
Instead of Future, futures::Stream would seem to be a more reasonable choice. How do I keep watching on more events asynchronously otherwise?
Use Case:
Watching multiple operations happening to a Sled database (like with Iterator impl), but asynchronously.
Proposed Change:
impl futures::Stream for Subscriber {
type Item = Event;
....
}Who Benefits From The Change(s)?
Async Sled users.
Alternative Approaches
- Spawning blocking task to reach the
Iteratorimpl - Repeat
watch_prefixafter each received event. Assign sequence number to each entry in the database and explicitly retrieve entries that were added to the database while we were not "on the watch".