elastic / elasticsearch-rs

Official Elasticsearch Rust Client
https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/index.html
Apache License 2.0
695 stars 70 forks source link

[ENHANCEMENT] Migration to tokio 1.0 #152

Closed krojew closed 3 years ago

krojew commented 3 years ago

Is your feature request related to a problem? Please describe. Since tokio 0.3 was released, it would be great to migrate, otherwise it's necessary to wrap each future in a compatibility layer.

Describe the solution you'd like Migration to tokio 0.3. Any dependencies can be wrapped in a compatibility layer until they get updated too.

Describe alternatives you've considered tokio-compat-02 crate.

Additional context https://tokio.rs/blog/2020-10-tokio-0-3

EDIT: Should now update to tokio 1.0

fteychene commented 3 years ago

I tried to upgrade to tokio 0.3 and updated the code to make it build on a local branch.

The main struggle point on this migration is that we use hyper servers during tests runtime and reqwest for calling servers. Theses two libs still doesn't migrated to tokio 0.3 ATM.

Hyper server is failing because wanting to get the current Handle with tokio 2 that is not populated with tokio 3 and reqwest use hyper under the hood.

Hyper migrated to tokio 3 in their master 0.14 dev branch, we just need to wait their migrations.

russcam commented 3 years ago

Thanks for the investigation, @fteychene - sounds like we need to wait for the moment. Would be happy to accept a PR for the migration, once it's possible.

krojew commented 3 years ago

reqwest got updated to tokio 1.0. It would be nice to update here, when they publish new crate.

swallez commented 3 years ago

@krojew we need support of Tokio 1.0 in reqwest. Indeed this has been merged but not yet included in a released.

swallez commented 3 years ago

And here it is, reqwest 0.11.0 was just released, based on Tokio 1.0. We can work on the migration.

Jasperav commented 3 years ago

Any update on the migration?