#job-scheduling #background-jobs #lock #mongo-db #extensible #run #management

ply_jobs

This crate provides the ability to run background jobs on a schedule

9 releases

0.1.8 Jan 9, 2024
0.1.7 Jan 8, 2024

#1659 in Database interfaces


Used in ply_tokio_redis_mongodb

MIT-0 license

37KB
910 lines

Job Manager

MIT licensed

Job Manager is a Rust crate for scheduling and managing asynchronous jobs.

Status

This is a very early release and completely untested. There will be frequent enhancements while we explore this create in the context of the ply backend crates.

If you'd like to contribute (eg by providing another storage implementation) please open an issue.

Features

  • Asynchronous job execution.
  • Job scheduling using cron-like expressions.
  • Flexible job runner implementations.
  • Extensible for custom job and lock repositories.
  • Lock management for job synchronization.

Example Usage

The counter example with MongoDB backend is a good place to start to understand how to use the jobs crate.

You can run this example like this:

docker-compose -f examples/counter/docker-compose.yml up -d
cargo run --example counter --features mongodb

Hit CTRL+C to stop the example and

docker-compose -f examples/counter/docker-compose.yml down

To stop the MongoDB container.

Dependencies

~7–23MB
~307K SLoC