Skip to content

Tokio incompatibility #82

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

Closed
manio opened this issue Dec 17, 2020 · 8 comments · Fixed by #92
Closed

Tokio incompatibility #82

manio opened this issue Dec 17, 2020 · 8 comments · Fixed by #92

Comments

@manio
Copy link

manio commented Dec 17, 2020

  • Rust Version:
    rustc 1.50.0-nightly (f76ecd066 2020-12-15)
  • Runtime version (e.g. Tokio):
    tokio = { version = "0.3.5", features = ["full"] }
  • OS Version:
    linux x86_64

I have an above tokio in my project, then I've added the influxdb crate in my Cargo.toml:
influxdb = { version = "0.3.0", features = ["derive"] }

In my async task started from main I've added an example code for influxdb call and I have this:
thread 'tokio-runtime-worker' panicked at 'there is no reactor running, must be called from the context of Tokio runtime', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.24/src/io/driver/mod.rs:204:1

Is it a way to solve this besides making my project compatible for old tokio v2? Maybe you could update the tokio in your crate for 0.3 which is now a current version for the tokio crate?

I'd like to stick with my newest tokio but I also like to use the influxdb at the same time... is it possible?

@blasrodri
Copy link
Contributor

@manio have you checked this repo?
https://github.com/LucioFranco/tokio-compat-02

@manio
Copy link
Author

manio commented Dec 17, 2020

@blasrodri
I was not aware of this crate. Thank you for this tip!
Yay! it is not the cleanest way to do it but it works!!! :)

I leave this issue open. Please close if you feel this has been resolved.

@Empty2k12
Copy link
Collaborator

What would you say is the cleanest way @manio?

@manio
Copy link
Author

manio commented Dec 27, 2020

@Empty2k12 rewrite to use current Tokio v0.3 :)

@Empty2k12
Copy link
Collaborator

@manio Now that tokio 1.0 is out we should rather use that?

@manio
Copy link
Author

manio commented Dec 27, 2020

Oh.. definitely ;)

@msrd0
Copy link
Collaborator

msrd0 commented Dec 27, 2020

Given that our tokio version is basically dictated by the hyper version used by surf, which is still 0.13 (using tokio 0.2), there is little that this crate can do other than switching to another http client - do you know one that already updated?

@Empty2k12
Copy link
Collaborator

However, for that, there's a couple of crate updates we need to await (pun intended).

surf depends on http-client which depends on hyper which depends on tokio. As soon as we're able to update, we should do it!

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

Successfully merging a pull request may close this issue.

4 participants