lemunozm / message-io

Fast and easy-to-use event-driven network library.
Apache License 2.0
1.12k stars 75 forks source link

There is no reactor running #116

Closed fgadaleta closed 2 years ago

fgadaleta commented 2 years ago

I am experiencing the error below thread '' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime',

when I send a message to a NodeListener and then spawn a thread in a tokio runtime to process that message.

Is this error familiar to anyone?

lemunozm commented 2 years ago

Hi,

Maybe the NodeListener callback is not called from the tokio context?

Are you using for_each or for_each_async to read the messages? The second one uses its own thread internally that will be out of the tokio context.