Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic due to missing Tokio reactor #19

Closed
mwbryant opened this issue Sep 29, 2022 · 1 comment
Closed

Panic due to missing Tokio reactor #19

mwbryant opened this issue Sep 29, 2022 · 1 comment

Comments

@mwbryant
Copy link

I'm trying to use this library in a project using the bevy game engine. Upon running I see this error:

thread 'main' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime', /home/matthew/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-system-resolver-0.5.0/src/system.rs:43:9

The line I'm trying to run is:

 let public_ip = block_on(public_ip::addr()).unwrap();

This happens on all combinations of features I have tried.

@mwbryant mwbryant changed the title Fails to with future tokio versions Panic due to missing tokio reactor Sep 29, 2022
@mwbryant mwbryant changed the title Panic due to missing tokio reactor Panic due to missing Tokio reactor Sep 29, 2022
@mwbryant
Copy link
Author

Solved by creating my own Tokio runtime:

    let mut rt = Runtime::new().unwrap();
    let public_ip = rt.block_on(public_ip::addr()).unwrap();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant