scheduled ~main
Simple CRON-style scheduling library.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
scheduled
Simple CRON-style scheduling library for D projects.
- Lightweight, pure-D solution
- Supports Cron schedules, as well as simple intervals and periods
- Well-documented
- Well-tested
Usage
The following is a barebones example for how to use scheduled.
import std.stdio;
import core.time;
import std.datetime;
import scheduled;
void main() {
JobScheduler scheduler = JobScheduler.getDefault();
scheduler.addJob(
() => writeln("Executing at " ~ Clock.currTime.toISOExtString),
new FixedIntervalSchedule(seconds(12))
);
scheduler.start();
}
In addition to the FixedIntervalSchedule
, the following is a list of all supported schedules:
OneTimeSchedule
- Executes a job once, at a specified timestamp.FixedIntervalSchedule
- Executes a job repeatedly, according to a specifiedDuration
interval.DailySchedule
- Executes a job one or more times per day, at specified times.CronSchedule
- Executes a job according to a Cron expression. For a precise overview of the supported cron syntax, please refer to Maxim Tyapkin'scronexp
library.
By default, the library comes with the following JobScheduler
implementations:
TaskPoolScheduler
- Scheduler which runs as a thread, and uses a TaskPool to execute jobs. It keeps all scheduled jobs in a priority queue, and sleeps until the nearest job should be executed.
- Registered by Andrew Lalis
- ~main released 4 months ago
- andrewlalis/scheduled
- github.com/andrewlalis/scheduled
- MIT
- Copyright © 2021, Andrew Lalis
- Authors:
- Dependencies:
- none
- Versions:
-
1.4.0 2024-Aug-05 1.3.0 2024-Aug-04 1.2.0 2023-Jul-17 1.1.0 2022-Mar-08 1.0.2 2021-Sep-22 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
35 downloads total
-
- Score:
- 1.5
- Short URL:
- scheduled.dub.pm