#task-runner #task #multi-threading #interval #task-scheduling #set-interval

interval-task

Repeatedly execute a Task with fixed time delay. more than setInterval

5 releases

0.3.3 Aug 26, 2024
0.3.2 Aug 13, 2024
0.2.0 Jun 21, 2024
0.1.1 Jun 16, 2024

#581 in Concurrency

Download history 164/week @ 2024-06-20 5/week @ 2024-06-27 8/week @ 2024-07-04 31/week @ 2024-07-25 211/week @ 2024-08-01 145/week @ 2024-08-08 25/week @ 2024-08-15 123/week @ 2024-08-22 26/week @ 2024-08-29 1/week @ 2024-09-05 35/week @ 2024-09-12 13/week @ 2024-09-19 7/week @ 2024-09-26 2/week @ 2024-10-03

57 downloads per month

MIT license

9KB
197 lines

interval-task

This crate provides a runner to simulate what setInterval does in JS which is repeatedly executing a task every given Duration.

But since in rust we can't have that kind of flexibility like js, the runner here provides much more usage except for just pass in the function and delay. Also provide a channel which wraps up runner

Please be aware that you have read runner doc.

This crate uses spin_sleep which provides accurate sleep. and i optimized to make the loop more accurate.

Purely thread with no async support.

Dependencies

~0.4–7MB
~44K SLoC