@nexim/task-scheduler
Version:
A TypeScript task scheduler with persistence and conditional execution.
17 lines (12 loc) • 1.11 kB
Markdown
[@nexim/task-scheduler](../README.md) / Task
# Interface: Task
Task configuration for the scheduler
## Properties
| Property | Type | Description |
| ----------------------------------- | ----------------------------------- | ------------------------------------------- |
| <a id="fn"></a> `fn` | () => `void` \| `Promise`\<`void`\> | Function to execute when task runs |
| <a id="id"></a> `id` | `string` | Unique identifier for the task |
| <a id="interval"></a> `interval` | `number` | Interval between executions in milliseconds |
| <a id="lastrun"></a> `lastRun` | `number` | Timestamp of last execution |
| <a id="nextrun"></a> `nextRun` | `number` | Timestamp when task should run next |
| <a id="shouldrun"></a> `shouldRun?` | () => `boolean` | Optional condition to check before running |