Hello there
Thank you very much for featuring timerfd to tokio, it saved my realtime applications in etherage
At the moment, tokio_timerfd::Interval can only be used as an async iterator (or close to it, since rust truly supports async iterators) through the trait Stream, however it does not bring much more than a mere Future
- no nice syntax using stream
- more complex call to the timer
From a user point of view, using Interval as a Stream leads to a weird line like this
let interval = Interval::new_interval(...);
interval.next().await.unwrap()?;
as a Future it could be more straight forward
let interval = Interval::new_interval(...);
interval.await?;
Looking at the current implementation of Stream, it looks like Future could be implemented using the exact same code. Do you think an impl Future could be added mirroring Stream (or vice-versa) ?
Hello there
Thank you very much for featuring
timerfdtotokio, it saved my realtime applications in etherageAt the moment,
tokio_timerfd::Intervalcan only be used as an async iterator (or close to it, since rust truly supports async iterators) through the traitStream, however it does not bring much more than a mereFutureFrom a user point of view, using
Intervalas aStreamleads to a weird line like thisas a
Futureit could be more straight forwardLooking at the current implementation of
Stream, it looks likeFuturecould be implemented using the exact same code. Do you think animpl Futurecould be added mirroringStream(or vice-versa) ?