diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-01-09 13:04:38 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-01-09 13:04:38 +0300 |
commit | c380a3ea3d75cb6529aeebfeeb8299f0f618af63 (patch) | |
tree | 8e8fb6be015d2d281b047bba8b06ecb36db9a55f /net | |
parent | 2b7cebb02a834345655c7e45e510b16ce41e7679 (diff) |
requesthttpsrc: Port to tokio 1.0
Diffstat (limited to 'net')
-rw-r--r-- | net/reqwest/Cargo.toml | 6 | ||||
-rw-r--r-- | net/reqwest/src/reqwesthttpsrc/imp.rs | 10 | ||||
-rw-r--r-- | net/reqwest/tests/reqwesthttpsrc.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/net/reqwest/Cargo.toml b/net/reqwest/Cargo.toml index 02df32b61..e0072d6ef 100644 --- a/net/reqwest/Cargo.toml +++ b/net/reqwest/Cargo.toml @@ -10,17 +10,17 @@ edition = "2018" [dependencies] url = "2.1" glib = { git = "https://github.com/gtk-rs/gtk-rs" } -reqwest = { version = "0.10", features = ["cookies", "gzip"] } +reqwest = { version = "0.11", features = ["cookies", "gzip"] } futures = "0.3" hyperx = "1.0" mime = "0.3" gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_10"] } gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } -tokio = { version = "0.2", features = ["time", "rt-threaded"] } +tokio = { version = "1.0", default-features = false, features = ["time", "rt-multi-thread"] } once_cell = "1.0" [dev-dependencies] -hyper = "0.13" +hyper = { version = "0.14", features = ["server"] } [lib] name = "gstreqwest" diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index a11e6be2d..8c0f223d0 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -225,10 +225,9 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { }); static RUNTIME: Lazy<runtime::Runtime> = Lazy::new(|| { - runtime::Builder::new() - .threaded_scheduler() + runtime::Builder::new_multi_thread() .enable_all() - .core_threads(1) + .worker_threads(1) .build() .unwrap() }); @@ -669,7 +668,10 @@ impl ReqwestHttpSrc { } }; - let res = RUNTIME.enter(|| futures::executor::block_on(future)); + let res = { + let _enter = RUNTIME.enter(); + futures::executor::block_on(future) + }; /* Clear out the canceller */ let _ = self.canceller.lock().unwrap().take(); diff --git a/net/reqwest/tests/reqwesthttpsrc.rs b/net/reqwest/tests/reqwesthttpsrc.rs index 713aaf970..96b08a051 100644 --- a/net/reqwest/tests/reqwesthttpsrc.rs +++ b/net/reqwest/tests/reqwesthttpsrc.rs @@ -97,10 +97,8 @@ impl Harness { pad.set_active(true).unwrap(); // Create the tokio runtime used for the HTTP server in this test - let rt = tokio::runtime::Builder::new() - .core_threads(1) + let rt = tokio::runtime::Builder::new_multi_thread() .enable_all() - .threaded_scheduler() .build() .unwrap(); |