lholden / job_scheduler

A simple cron-like job scheduling library for Rust.
Apache License 2.0
196 stars 34 forks source link

fix `dyn std::ops::FnMut()` cannot be sent between threads safely #20 #21

Open alopatindev opened 4 years ago

rakshith-ravi commented 4 years ago

@lholden can we have this merged and published to crates.io please?

bellackn commented 3 years ago

Seconding that @alopatindev - awesome crate, but this PR would make it even more awesome, @lholden! :) Tested it and this fixes it in my case:

    thread::spawn(move || {
        loop {
            schedule.tick();
            thread::sleep(std::time::Duration::from_secs(60));
        }
    });
BlackDex commented 1 year ago

This PR is implemented in https://crates.io/crates/job_scheduler_ng (with some minor changes).