
Product
Go Support Is Now Generally Available
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
@coya/task-manager
Advanced tools
Scheduler for run tasks successively or simultaneously.
npm install @coya/task-manager
git clone https://github.com/Cooya/TaskManager
cd TaskManager
npm install // it will also install the development dependencies
npm run build
npm run example // run the example script in "examples" folder
const { TaskManager, Task } = require('@coya/task-manager');
const firstTask = new Task('firstTask', 10, function() {
console.log('hello');
return Promise.resolve();
});
const secondTask = new Task('secondTask', 5, function() {
console.log('hola');
return Promise.resolve();
});
const thirdTask = new Task('thirdTask', 2, function() {
console.log('failure');
return Promise.reject();
});
const taskManager = new TaskManager();
taskManager.end(function() {
console.log('All tasks have been stopped, task manager shutted down.');
});
taskManager.processAsynchronousTasks([firstTask, secondTask, thirdTask]);
Process tasks list successively, it means that tasks are executed one by one. The following task is executed once the previous one is done.
Parameter | Type | Description | Default value |
---|---|---|---|
taskList | array | list of objects implementing or inheriting the Task class | none |
Process tasks list simultaneously, it means that tasks are executed in the same time (using setTimeout()). It is different from setInterval() because the timer is launched after the task has been processed.
Parameter | Type | Description | Default value |
---|---|---|---|
taskList | array | list of objects implementing or inheriting the Task class | none |
The Task class, and so its constructor, contains three fields :
FAQs
Scheduler for run tasks successively or simultaneously
The npm package @coya/task-manager receives a total of 12 weekly downloads. As such, @coya/task-manager popularity was classified as not popular.
We found that @coya/task-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
Security News
vlt adds real-time security selectors powered by Socket, enabling developers to query and analyze package risks directly in their dependency graph.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.