How to use tokio thread

thread 'main' panicked at 'Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.', /home/cery/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/runtime/enter.rs:38:5

i don't know how this be occurred. can somebody help me?

You can't start a runtime inside a runtime. Are you e.g. using #[tokio::main] and Builder at the same time? You can see where it happens by turning on backtraces.

thread 'tokio-runtime-worker' panicked at 'there is no timer running, must be called from the context of Tokio runtime', /home/cery/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.21/src/time/driver/handle.rs:24:9

i remove that error but the new occur

You still need .enable_all().

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.