An async task scheduler with support for:
- Priority-based execution
- Concurrency limits
- Task dependencies
- Optional priority-based deduplication per ID
- Promise-based task results
Clone the repository:
git clone https://github.com/crytek1012/task-scheduler.git
cd task-scheduler
npm installBuild:
npm run buildimport { Queue, TaskPriority } from './src';
const queue = new Queue({ concurrency: 2 });
queue.addTask('task-1', TaskPriority.High, async () => {
console.log('High priority task');
});
queue.addTask('task-2', TaskPriority.Low, async () => {
console.log('Low priority task');
});| Option | Type | Default | Description |
|---|---|---|---|
concurrency? |
number | 1 | Maximum number of tasks allowed to run in parallel. |
removeLowerTasks? |
boolean | false | Remove tasks for the same ID if they have a lower priority. |
Created by Crytek1012.
This project is licensed under the MIT License.