ThreadedJobScheduler

A simple thread-based scheduler that sleeps until the next task, and runs it using a task pool.

Constructors

this
this(TaskPool taskPool, CurrentTimeProvider timeProvider)
Undocumented in source.
this
this()
Undocumented in source.

Members

Functions

addJob
void addJob(ScheduledJob job)
Undocumented in source. Be warned that the author may not have intended to support it.
run
void run()

Runs the scheduler. This works by popping the next scheduled task from the priority queue (since scheduled tasks are ordered by their next execution date) and sleeping until we reach that task's execution date.

start
void start()
Undocumented in source. Be warned that the author may not have intended to support it.
stop
void stop(bool force)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From JobScheduler

addJob
void addJob(ScheduledJob job)

Adds a job to the scheduler.

addJob
void addJob(Job job, JobSchedule schedule)

Adds a job to the scheduler, with the given schedule to define when it should be run.

addJob
void addJob(void function() fn, JobSchedule schedule)

Adds a simple job that executes the given function according to the given schedule.

addCronJob
void addCronJob(Job job, string cronExpressionString)

Adds a job to the scheduler, whose schedule is defined by the given cron expression string.

start
void start()

Starts the scheduler. Once started, there is no guarantee that all scheduler implementations will allow adding new jobs while running.

stop
void stop(bool force)

Stops the scheduler.

stop
void stop()

Stops the scheduler, and waits for any currently-executing jobs to finish. Functionally equivalent to calling stop(false).

Meta