A comprehensive task management module for Node.js
npm install @task-master/task-queue
Represents a reference to a database.
const { TaskDBRef } = require('@task-master/task-queue');
// Example: Creating a reference to a MongoDB database
const dbRef = new TaskDBRef('mongodb://localhost:27017/mydb');
Represents a reference to a MongoDB database.
const { TaskMongoDBRef } = require('@task-master/task-queue');
// Example: Creating a reference to a MongoDB collection
const mongoDBRef = new TaskMongoDBRef('my_collection');
Represents a reference to a Mongoose model.
const { TaskMongooseRef } = require('@task-master/task-queue');
const mongoose = require('mongoose');
// Example: Creating a reference to a Mongoose model
const MyModel = mongoose.model('MyModel', { name: String });
const mongooseRef = new TaskMongooseRef(MyModel);
Represents a reference to a bulk database operation.
const { TaskBulkDBRef } = require('@task-master/task-queue');
// Example: Creating a reference to multiple database records
const bulkDBRef = new TaskBulkDBRef(['id1', 'id2', 'id3']);
Represents a reference to a bulk MongoDB database operation.
const { TaskBulkMongoDBRef } = require('@task-master/task-queue');
// Example: Creating a reference to multiple MongoDB records
const bulkMongoDBRef = new TaskBulkMongoDBRef(['mongodb_id1', 'mongodb_id2']);
Represents a generic storage reference.
const { TaskStorageRef } = require('@task-master/task-queue');
// Example: Creating a generic storage reference
const storageRef = new TaskStorageRef(dataObject);
Represents a reference to a local storage.
const { TaskLocalStorageRef } = require('@task-master/task-queue');
// Example: Creating a reference to local storage
const localStorageRef = new TaskLocalStorageRef(dataObject, 'container_name');
Represents a reference to a remote storage.
const { TaskRemoteStorageRef } = require('@task-master/task-queue');
// Example: Creating a reference to remote storage
const remoteStorageRef = new TaskRemoteStorageRef(dataObject, 'remote_host');
Represents a reference to an Amazon S3 storage.
const { TaskS3StorageRef } = require('@task-master/task-queue');
// Example: Creating a reference to Amazon S3 storage
const s3StorageRef = new TaskS3StorageRef(dataObject, 's3_bucket');
s3StorageRef.setRegion('us-east-1');
Represents a reference to Google Cloud Storage (GCS).
const { TaskGCSStorageRef } = require('@task-master/task-queue');
// Example: Creating a reference to Google Cloud Storage (GCS)
const gcsStorageRef = new TaskGCSStorageRef(dataObject, 'gcs_bucket');
Represents a reference to FTP storage.
const { TaskFTPStorageRef } = require('@task-master/task-queue');
// Example: Creating a reference to FTP storage
const ftpStorageRef = new TaskFTPStorageRef(dataObject, 'ftp_host');
ftpStorageRef.setUsername('username').setPassword('password').setPort(21);
Represents a task in a task management system.
const { Task } = require('@task-master/task-queue');
// Example: Creating a task
const task = new Task('task_id');
task.setStatus('in_progress');
task.setPriority(2);
A class responsible for creating and managing tasks.
const { TaskCreator } = require('@task-master/task-queue');
// Example: Creating a task creator
const taskCreator = new TaskCreator({ taskType: 'main', immediate: true });
taskCreator.setSchedule('*/5 * * * *'); // Run every 5 minutes
Represents the payload for a task.
const { TaskPayload } = require('@task-master/task-queue');
// Example: Creating a task payload
const payload = new TaskPayload();
payload.setBody({ message: 'Task payload message' });
Represents a generic task worker responsible for managing task execution and state.
const { TaskWorker } = require('@task-master/task-queue');
// Example: Creating a task worker
const taskWorker = new TaskWorker(task);
taskWorker.setProgress(50); // Set progress to 50%
This project is licensed under the GNU AGPLv3 License - see the LICENSE.md file for details.