Skip to content

Install

pito-jobs is a Rust library, pulled from GitHub by its tag. It needs Rust 1.91 or newer.

The same line on all three:

Terminal window
cargo add pito-jobs --git https://github.com/gmrdad82/pito-jobs --tag v1.0.2

or in your Cargo.toml:

pito-jobs = { git = "https://github.com/gmrdad82/pito-jobs", tag = "v1.0.2" }

It works on Linux and macOS, and on Windows through WSL; CI tests it on Linux and macOS.

The crate also builds for native Windows and for wasm32. On wasm every handle is inert, so a cross-platform app can link it unconditionally and call it everywhere. Native Windows builds, but CI does not run its tests there.

In the tool:

let job = pito_jobs::start("encode", None, "talk.mp4 → web.mp4");
job.stage("encode", Some(240), "frames");
for frame in 1..=240 {
job.progress(frame);
}
job.finish(0);

While it runs, the job folder holds one JSON file for it, named <pid>-<started>.json. The folder is $PITO_JOBS_DIR when set, else $XDG_RUNTIME_DIR/pito-jobs on Linux, else $TMPDIR/pito-jobs on macOS. Any program can read the records back with pito_jobs::read_dir; see Read jobs back.

To watch three jobs write while a reader draws them, as in the clip on the overview:

Terminal window
git clone https://github.com/gmrdad82/pito-jobs && cd pito-jobs
cargo run --release --example demo

The other examples are heartbeat, lines and bench, each run the same way.