Muffin
Muffin is a background job processing library designed to work with MongoDB as its storage backend.
Requires MongoDB 6 with feature compatibility level set to 6.
Example
// Connect to a database called "muffin_testing".
let client = with_uri_str.await?;
let database = client.database;
// The state is passed to each "process" method on an instance of Job.
let state = JobState ;
let mut muffin = new.await?;
// Create a new job and push it for processing
muffin
.push
.await?;
// Register jobs that should be processed.
muffin.;
// Start processing jobs.
select! ;
// Need to wait for all in-flight jobs to finish processing.
muffin.shutdown.await;
License
- MIT license