Skip to content

Latest commit

 

History

History

sched

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 




lool » sched is a utility library that provides a way to schedule tasks in various ways. Supports std::thread and the tokio runtime (as a feature flag).




Installation

This library is for internal use. And as such, it's only published privately.

cargo add lool --registry=lugit --features sched {sub-feature}

Sub-Features

Runtimes

At least one of the following features must be enabled to use this library.

  • has subfeatures   sched.tokio: Enables the tokio runtime support.

  • has subfeatures   sched.threads: Enables the std::thread runtime support.

  • has subfeatures   sched.thread-pool: Enables the std::thread runtime support with a thread pool unimplemented

Scheduling Rules

The default way to schedule tasks is to use a DateTime object. However, that means that the task will only run once. To schedule tasks to run at specific intervals, you can use the following features:

  • has subfeatures   sched.rule-recurrent: Enables the "recurrent-rule" style for scheduling tasks.

  • has subfeatures   sched.rule-cron: Enables the "cron-like" style for scheduling tasks

Planned Features

  • sched.rule-pyschedule: Enables the python schedule-like style for scheduling tasks
  • sched.thread-pool: Enables the std::thread runtime support with a thread pool (like scheduled-thread-pool crate but using lool's thread pool implementation)

Usage

Check the examples directory for usage examples:

  • tokio: using the tokio runtime
  • threads: using the std::thread runtime

Inspiration

This library is inspired by several other libraries, including: