Skip to content

Tokio 1.0 Signal no longer implements Stream #3432

Answered by Darksonn
djmarcin asked this question in Q&A
Discussion options

You must be logged in to vote

You can turn it into a Stream using the async-stream crate.

let stream = async_stream::stream! {
    loop {
        signal.recv().await;
        yield ();
    }
};

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@djmarcin
Comment options

@Darksonn
Comment options

@Darksonn
Comment options

Answer selected by taiki-e
Comment options

You must be logged in to vote
1 reply
@Darksonn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants