{"id":24141399,"url":"https://github.com/shuo-s-feng/taskon","last_synced_at":"2025-09-19T09:33:08.722Z","repository":{"id":63769095,"uuid":"570570982","full_name":"shuo-s-feng/taskon","owner":"shuo-s-feng","description":"A simple javascript/typesciprt tasks queue that supports concurrency control, designed by Shuo Feng","archived":false,"fork":false,"pushed_at":"2025-01-09T11:10:46.000Z","size":182,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T12:31:12.407Z","etag":null,"topics":["asynchronous","concurrency","javascript","task-queue","typescript"],"latest_commit_sha":null,"homepage":"https://shuo-s-feng.github.io/simple-js-task-queue/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shuo-s-feng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-25T14:07:27.000Z","updated_at":"2025-01-09T11:10:50.000Z","dependencies_parsed_at":"2025-01-09T12:31:16.943Z","dependency_job_id":null,"html_url":"https://github.com/shuo-s-feng/taskon","commit_stats":null,"previous_names":["sup-friday/simple-js-task-queue","shuo-s-feng/taskon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuo-s-feng%2Ftaskon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuo-s-feng%2Ftaskon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuo-s-feng%2Ftaskon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuo-s-feng%2Ftaskon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuo-s-feng","download_url":"https://codeload.github.com/shuo-s-feng/taskon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233562843,"owners_count":18694719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","concurrency","javascript","task-queue","typescript"],"created_at":"2025-01-12T04:09:45.933Z","updated_at":"2025-09-19T09:33:08.712Z","avatar_url":"https://github.com/shuo-s-feng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# taskon\n\n[![Test](https://github.com/shuo-s-feng/taskon/actions/workflows/test.yml/badge.svg)](https://github.com/shuo-s-feng/taskon/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/shuo-s-feng/taskon/branch/main/graph/badge.svg)](https://codecov.io/gh/shuo-s-feng/taskon)\n\nA simple javascript/typesciprt tasks queue that supports dynamic concurrency control, designed by\n\u003ca href=\"https://gravatar.com/shuosfeng/\"\u003eShuo Feng\u003c/a\u003e.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Installation](#installation)\n- [Demo](#demo)\n- [Usage](#usage)\n- [API Reference](#api-reference)\n- [License](#license)\n\n## Introduction\n\nThis lightweight, error-tolerant, no-dependency library provides a sophisticated taks queue management system designed for TypeScript and JavaScript applications, providing advanced functionalities for managing, executing, and monitoring synchronous and asynchronous tasks.\n\n## Features\n\n- **Advanced Task Management**: Efficiently manage tasks with customizable priorities and statuses.\n- **Concurrency Control**: Fine-tune the execution of tasks with dynamic concurrency settings.\n- **Error Handling**: Comprehensive options for error management including retry mechanisms.\n- **Integrated Logging**: Leverage built-in logging for easy monitoring and debugging.\n- **Flexible Task Prioritization**: Utilize various prioritization strategies to control task execution order.\n\n## Installation\n\n```bash\nyarn add taskon\n```\n\nOr\n\n```bash\nnpm install taskon\n```\n\n## Demo\n\nCheck out [this codesanbox project](https://codesandbox.io/s/react-typescript-forked-knts9f)!\n\n## Usage\n\nBelow is a simple example demonstrating how to use the `TaskQueue` to add and execute a task:\n\n```typescript\nimport { TaskQueue } from 'taskon';\n\nconst queue = new TaskQueue();\n\nqueue\n  .addTask(async () =\u003e {\n    console.log('Performing a task...');\n    // Task implementation\n  })\n  .then((result) =\u003e {\n    console.log('Task completed.');\n  });\n```\n\n## API Reference\n\n### TaskQueue Class\n\nThe `TaskQueue` class is at the core of the library, offering a rich set of methods to manage tasks:\n\n| Method Name                   | Description                                                                 | Parameters                             |\n| ----------------------------- | --------------------------------------------------------------------------- | -------------------------------------- |\n| `addTask`                     | Adds a new task to the queue.                                               | `callback, onStatusUpdate?, priority?` |\n| `addPrioritizedTask`          | Adds a high-priority task to the queue.                                     | `callback, onStatusUpdate?`            |\n| `addTasks`                    | Bulk addition of tasks.                                                     | `tasks`                                |\n| `adjustConcurrency`           | Adjusts the number of tasks that can run concurrently, effective instantly. | `newConcurrency`                       |\n| `start`                       | Starts or resumes task execution.                                           |                                        |\n| `stop`                        | Pauses task execution.                                                      |                                        |\n| `retry`                       | Retries failed tasks.                                                       |                                        |\n| `subscribeTaskStatusChange`   | Subscribes to task status updates.                                          | `onTaskStatusUpdate`                   |\n| `unsubscribeTaskStatusChange` | Unsubscribes from task status updates.                                      | `onTaskStatusUpdate`                   |\n| `getTaskDetails`              | Fetches details of a specific task.                                         | `taskId`                               |\n| `getAllTasksDetails`          | Retrieves details of all tasks, optionally filtered by status.              | `status?`                              |\n| `getConcurrency`              | Fetches the concurrency of the task queue.                                  |                                        |\n| `isManuallyStopped`           | Checks if the task queue is manually stopped.                               |                                        |\n| `clearTaskDetails`            | Clears details of a specific task.                                          | `taskId`                               |\n| `clearAllTasksDetails`        | Removes details of all tasks from memory.                                   |                                        |\n| `clearFailedRetryableTasks`   | Clears the list of failed tasks marked for retry.                           |                                        |\n| `clearWaitedTasks`            | Removes all tasks waiting to be executed.                                   |                                        |\n| `removeFailedRetryableTask`   | Removes a specific task from the retry list.                                | `taskIdOrTask`                         |\n| `removeWaitedTask`            | Removes a specific task from the waiting list.                              | `taskIdOrTask`                         |\n\nFor more detailed information on each method, including parameter types and return values, please refer to the TypeDoc generated documentation in the `docs` folder or [this link](https://shuo-s-feng.github.io/taskon/).\n\n## License\n\nThis library is [MIT licensed](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuo-s-feng%2Ftaskon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuo-s-feng%2Ftaskon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuo-s-feng%2Ftaskon/lists"}