-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
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
Using a duration value less than 500ms #89
Comments
Hi
That is the case, yes. It was informed by the cron library used that only dealt up/until second resolution.
However, the more the scheduler runs the more cpu is used. Nothing hinders us to have this as a configuration option in the future though.
Groete / Best regards
Michael van Niekerk
…________________________________
Van: Kabir Idris ***@***.***>
Gestuur: Tuesday, November 12, 2024 1:25:26 PM
aan: mvniekerk/tokio-cron-scheduler ***@***.***>
Aa: Michael van Niekerk ***@***.***>; Mention ***@***.***>
onderwerp: [mvniekerk/tokio-cron-scheduler] Using a duration value less than 500ms (Issue #89)
Hello @mvniekerk<https://github.com/mvniekerk>
Thanks for this awesome library.
I need a bit of clarification on the minimum possible value of the Duration for Job::new_repeated_async function. From the source code
it stated that a new job will only be created after the delay of 500ms
Create a new async repeated job. This is checked if it is running only after 500ms in 500ms intervals. let mut sched = JobScheduler::new(); let job = Job::new_repeated_async(Duration::from_secs(8), |_uuid, _lock| Box::pin(async move { println!("{:?} I'm repeated every 8 seconds", chrono::Utc::now()); })); sched.add(job) tokio::spawn(sched.start());
Does this mean that we cannot have a repeated scheduler with duration less than 500ms ?
Thanks
—
Reply to this email directly, view it on GitHub<#89>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAL7O725DJ2TCW3YR3IVEGD2AHQSNAVCNFSM6AAAAABRT2NCSOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2TCOBZGYYTQMY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I see. having the default value as a config can be a good idea. I'm constrained to us this for scheduler that are meant to run in less than 100ms. Thanks for the quick response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @mvniekerk
Thanks for this awesome library.
I need a bit of clarification on the minimum possible value of the
Duration
forJob::new_repeated_async
function. From the source codeit stated that a new job will only be created after the delay of 500ms
Create a new async repeated job. This is checked if it is running only after 500ms in 500ms intervals. let mut sched = JobScheduler::new(); let job = Job::new_repeated_async(Duration::from_secs(8), |_uuid, _lock| Box::pin(async move { println!("{:?} I'm repeated every 8 seconds", chrono::Utc::now()); })); sched.add(job) tokio::spawn(sched.start());
Does this mean that we cannot have a repeated scheduler with duration less than 500ms ?
Thanks
The text was updated successfully, but these errors were encountered: