-
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.
Answered by
Darksonn
Jan 15, 2021
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.
3 replies
Answer selected by
taiki-e
-
Are there any plans to add something to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can turn it into a
Stream
using theasync-stream
crate.