diff --git a/Cargo.lock b/Cargo.lock index 712902b..f2a5a8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1312,6 +1312,7 @@ checksum = "a63d25391d04a097954b76aba742b6b5b74f213dfe3dbaeeb36e8ddc1c657f0b" dependencies = [ "atomic", "crossbeam-queue", + "futures", "log", "pin-project 1.0.8", "pollster", diff --git a/plugins/Cargo.toml b/plugins/Cargo.toml index 759116a..2a0ee9c 100644 --- a/plugins/Cargo.toml +++ b/plugins/Cargo.toml @@ -16,7 +16,7 @@ human_format = "1.0" human-sort = "0.2" new_mime_guess = "3" pop-launcher = { path = "../" } -postage = "0.4" +postage = { version = "0.4", features = ["futures-traits"] } regex = "1" ron = "0.6" serde = "1" diff --git a/service/Cargo.toml b/service/Cargo.toml index d7dd8b0..59cb234 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -14,7 +14,7 @@ futures-lite = "1" gen-z = "0.1" num_cpus = "1" pop-launcher = { path = "../" } -postage = "0.4" +postage = { version = "0.4", features = ["futures-traits"] } regex = "1.5" ron = "0.6" serde = { version = "1", features = ["derive"] } diff --git a/service/src/lib.rs b/service/src/lib.rs index 3fe492b..78e0a2e 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -37,19 +37,17 @@ pub async fn main() { } }); - let (output_tx, mut output_rx) = postage::mpsc::channel(16); + let (output_tx, mut output_rx) = mpsc::channel(16); // Service will operate for as long as it is being awaited let service = Service::new(output_tx).exec(input_stream); // Responses from the service will be streamed to stdout let responder = async move { - use postage::prelude::Stream; - let stdout = io::stdout(); let stdout = &mut stdout.lock(); - while let Some(response) = output_rx.recv().await { + while let Some(response) = output_rx.next().await { serialize_out(stdout, &response); } }; @@ -84,7 +82,6 @@ impl Service { pub async fn exec(mut self, input: impl Stream) { let (service_tx, service_rx) = mpsc::channel(1); - let stream = plugins::external::load::from_paths(); futures_lite::pin!(stream); @@ -121,8 +118,7 @@ impl Service { } async fn response_handler(&mut self, mut service_rx: mpsc::Receiver) { - use postage::prelude::Stream; - while let Some(event) = service_rx.recv().await { + while let Some(event) = service_rx.next().await { match event { Event::Request(request) => { match request {