mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-21 11:30:59 +00:00
update tokio-example
This commit is contained in:
parent
c01a3544bc
commit
eff0956740
1 changed files with 3 additions and 1 deletions
|
@ -40,7 +40,7 @@ async fn main() -> Result<(), Error> {
|
|||
let queue_handle = WorkerConfig::new(storage, |_| MyState::new("My App"))
|
||||
.register::<MyJob>()
|
||||
.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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue