We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dyn std::ops::FnMut()
Thanks for this crate. It'd be handy to use it in async programs.
run: Box<dyn (FnMut() -> ()) + 'a> causes
run: Box<dyn (FnMut() -> ()) + 'a>
`dyn std::ops::FnMut()` cannot be sent between threads safely
in the following example:
use job_scheduler::{Job, JobScheduler}; use std::time::Duration; use tokio::time::delay_for; #[tokio::main] async fn main() { let mut scheduler = JobScheduler::new(); scheduler.add(Job::new("1/1 * * * * * *".parse().unwrap(), || { dbg!("hello"); })); tokio::spawn(async move { loop { scheduler.tick(); delay_for(Duration::from_millis(500)).await; } }) .await .unwrap(); }
[package] name = "hello_job_scheduler" version = "0.1.0" edition = "2018" [dependencies] job_scheduler = "1" tokio = { version = "0.2", features = ["rt-threaded", "macros", "time"]}
The text was updated successfully, but these errors were encountered:
fix dyn std::ops::FnMut() cannot be sent between threads safely lho…
dcad482
…lden#20
No branches or pull requests
Thanks for this crate. It'd be handy to use it in async programs.
run: Box<dyn (FnMut() -> ()) + 'a>
causesin the following example:
The text was updated successfully, but these errors were encountered: