job_queue
Setup
Usage
Create a job
use ;
Create a queue and dispatch a job
use ;
let queue = builder
.connect // or postgres://root:@localhost/job_queue
.await?;
queue
.dispatch
.await?;
Create a worker
use ;
use Duration;
let worker = builder
.max_connections
.worker_count
.connect // or postgres://root:@localhost/job_queue
.await?;
worker.start.await?; // blocks forever, or until all workers are stopped (crash or ctrl-c)
TODO:
- emit events, failing, stopping, before and after processing a job