Expand description

Rust crate to execute jobs in an async way

Example:

use job_dispatcher::job::Job;

#[tokio::main]
async fn main() {
    let path = "C:\\Users\\sn99\\Downloads\\privacy-script.bat";

let mut job = Job::new("trash", path);

// start a job
    job.start();

// check is the job is done (does not block)
    println!("Job done?: {:?}", job.try_wait());

// wait for it to finish (will block), will error out if previous statement returns `Ok`, use `match` to handle them
    job.wait().await.expect("Job failed");

println!("Job exited with code: {:?}", job.get_status());
}

Modules

Holds our Job struct and its methods and functions to execute jobs in an async way