scheduled 1.0.2

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.

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 = new ThreadedJobScheduler;
	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 specified Duration 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's cronexp library.

By default, the library comes with the following JobScheduler implementations:

  • ThreadedJobScheduler - 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.
Authors:
  • Andrew Lalis <andrewlalisofficial@gmail.com>
Dependencies:
cronexp
Versions:
1.0.2 2021-Sep-22
1.0.1 2021-Sep-21
1.0.0 2021-Sep-21
~main 2021-Sep-22
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 1 downloads total

Score:
0.5
Short URL:
scheduled.dub.pm