Skip to content

'there is no reactor running, must be called from the context of a Tokio 1.x runtime' #2592

Closed Answered by nikkolasg
nikkolasg asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I found the related issue #2230 and then found how to setup properly the tokio executor here

For reference, solved it with

let mut swarm = SwarmBuilder::new(
            tokio_development_transport(self.kp.clone()).unwrap(),
            MyBehaviour { ... }, ... )
        .executor(Box::new(|fut| {
            tokio::spawn(fut);
        }))
        .build();

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@michael-herwig
Comment options

Answer selected by nikkolasg
Comment options

You must be logged in to vote
0 replies
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