From eff0956740184b243358ebaba71af91f9fb385a0 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 14 Jan 2024 12:48:56 -0500 Subject: [PATCH] update tokio-example --- examples/tokio-example/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/tokio-example/src/main.rs b/examples/tokio-example/src/main.rs index 53a388a..03cb1ce 100644 --- a/examples/tokio-example/src/main.rs +++ b/examples/tokio-example/src/main.rs @@ -40,7 +40,7 @@ async fn main() -> Result<(), Error> { let queue_handle = WorkerConfig::new(storage, |_| MyState::new("My App")) .register::() .set_worker_count(DEFAULT_QUEUE, 16) - .start(); + .start()?; // Queue our jobs queue_handle.queue(MyJob::new(1, 2)).await?; @@ -55,6 +55,8 @@ async fn main() -> Result<(), Error> { // Block on Tokio tokio::signal::ctrl_c().await?; + drop(queue_handle); + Ok(()) }