Scheduler
Properties
Section titled “Properties”Type: Bot
activeJob Getter
Section titled “activeJob ”Type: Job | null
size Getter
Section titled “size ”Gets the number of jobs in the scheduler.
Type: number
Methods
Section titled “Methods”addJob
Section titled “addJob”Adds a job to the scheduler.
| Parameter | Type | Description |
|---|---|---|
| job | Job | The job to add. |
Returns: void
getJob
Section titled “getJob”Get a job.
| Parameter | Type | Description |
|---|---|---|
| jobId | string | The ID of the job. |
Returns: T | null
hasJob
Section titled “hasJob”| Parameter | Type | Description |
|---|---|---|
| jobId | string |
Returns: boolean
isRunning
Section titled “isRunning”Whether the scheduler is currently running.
Returns: boolean
removeJob
Section titled “removeJob”Removes a job from the scheduler.
| Parameter | Type | Description |
|---|---|---|
| job | Job | The job to remove. |
Returns: void
Starts the scheduler, executing jobs in order of priority. Jobs with higher priority (larger number) are executed first.
Returns: Promise<void>
Stops the scheduler.
Returns: void