-
In tokio 0.3.6 tokio::signal::unix::Signal implemented Stream, but in 1.0.2 it does not. This means it can no longer be passed to things like How should such code be migrated? Is there a way to wrap a Signal in a Stream? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can turn it into a let stream = async_stream::stream! {
loop {
signal.recv().await;
yield ();
}
}; |
Beta Was this translation helpful? Give feedback.
-
Are there any plans to add something to |
Beta Was this translation helpful? Give feedback.
You can turn it into a
Stream
using theasync-stream
crate.