torotask
Version:
Task queue processing in NodeJS based on BullMQ and Redis
29 lines • 1.27 kB
TypeScript
import type { FlowJob, FlowJobBase, Job } from 'bullmq';
import type { ToroTask } from './client.js';
import type { TaskFlowRun, TaskFlowRunNode, TaskJobOptions, TaskQueueOptions } from './types/index.js';
import { FlowProducer } from 'bullmq';
export declare class TaskWorkflow extends FlowProducer {
readonly taskClient: ToroTask;
constructor(taskClient: ToroTask, options?: Partial<TaskQueueOptions>);
/**
* Override the Job class to use TaskJob
* @returns The extended Job class.
*/
protected get Job(): typeof Job;
_convertToFlow<TResult extends FlowJobBase<any> = FlowJob, TRun extends TaskFlowRun = TaskFlowRun>(run: TRun, options?: Partial<TaskJobOptions>, removeParentOption?: boolean): TResult;
/**
* Run a flow with the given options
* @param run
* @param options
* @returns (Promise<TaskFlowRunNode>)
*/
runFlow(run: TaskFlowRun, options?: Partial<TaskJobOptions>): Promise<TaskFlowRunNode>;
/**
* Run multiple flows with the given options
* @param runs
* @param options
* @returns (Promise<TaskFlowRunNode[]>)
*/
runFlows(runs: TaskFlowRun[], options?: Partial<TaskJobOptions>): Promise<TaskFlowRunNode[]>;
}
//# sourceMappingURL=workflow.d.ts.map