mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-03 18:09:22 +00:00
requesthttpsrc: Port to tokio 1.0
This commit is contained in:
parent
2b7cebb02a
commit
c380a3ea3d
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue