Readonly [initProtected activeProtected activeProtected dbProtected generateProtected handlersProtected loggerProtected queueProtected queuingProtected Optional queuingReleases the queuing lock On the first iteration of the queuing loop the lock may not be acquired yet, and therefore releaser is not set
Protected queuingAsynchronous queuing loop
This is blocked by the queuingLock
The null indicates that the queuing loop isn't running
Protected schedulerProtected schedulingLock controls whether to run an iteration of the scheduling loop
Protected Optional schedulingReleases the scheduling lock On the first iteration of the scheduling loop the lock may not be acquired yet, and therefore releaser is not set
Protected schedulingAsynchronous scheduling loop
This is blocked by the schedulingLock
The null indicates that the scheduling loop isn't running
Protected schedulingTimer used to unblock the scheduling loop
This releases the schedulingLock if it is locked
The null indicates there is no timer running
Protected stopProtected taskProtected taskProtected tasksTracks actively running tasks
Tasks/active/{TaskId} -> null
Protected tasksProtected tasksMaintain last Task ID to preserve monotonicity across process restarts
Tasks/lastTaskId -> {raw(TaskId)}
Protected tasksTasks indexed path
Tasks/path/{...TaskPath}/{TaskId} -> null
Protected tasksQueued Tasks
This is indexed by TaskId at the end to avoid conflicts
Tasks/queued/{lexi(TaskPriority)}/{lexi(TaskTimestamp + TaskDelay)}/{TaskId} -> null
Protected tasksScheduled Tasks
This is indexed by TaskId at the end to avoid conflicts
Tasks/scheduled/{lexi(TaskTimestamp + TaskDelay)}/{TaskId} -> null
Protected tasksTasks collection
Tasks/tasks/{TaskId} -> {json(TaskData)}
Protected cancelProtected gcThis is used to garbage collect tasks that have settled Explicit removal of tasks can only be done through task cancellation
Optional tran: DBTransactionOptional tran: DBTransactionProtected lockProtected lockMutual exclusion for task mutation Used to lock:
this.updateTaskthis.queueTaskthis.startTaskthis.gcTaskthis.requeueTaskProtected queueTransition from scheduled to queued If the task is cancelled, then this does nothing
Protected repairProtected requeueOptional tran: DBTransactionSchedules a task
If this.schedulingLoop isn't running, then this will not
attempt to reset the this.schedulingTimer
Optional deadline?: numberOptional delay?: numberOptional lazy?: booleanOptional parameters?: TaskParametersOptional path?: TaskPathOptional priority?: numberOptional tran: DBTransactionOptional fresh?: booleanOptional handlers?: Record<TaskHandlerId, TaskHandler>Optional lazy?: booleanProtected startProtected startProtected startTransition from queued to active If the task is cancelled, then this does nothing
Protected stopProtected stopProtected triggerProtected triggerTriggers the scheduler on a delayed basis
If the delay is 0, the scheduler is triggered immediately
The scheduling timer is a singleton that can be set by both
this.schedulingLoop and this.scheduleTask
This ensures that the timer is set to the earliest scheduled task
Optional tran: DBTransactionStatic createOptional activeOptional fresh?: booleanOptional handlers?: Record<TaskHandlerId, TaskHandler>Optional lazy?: booleanOptional logger?: LoggerOptional stopGenerated using TypeDoc
Lock controls whether to run an iteration of the queuing loop