@sidequest/core
Version:
@sidequest/core is the core package of SideQuest, a distributed background job queue for Node.js and TypeScript applications.
25 lines (22 loc) • 788 B
TypeScript
import { JobData } from '../schema/job-data.js';
import { JobTransition } from './transition.js';
/**
* Transition for marking a job as completed.
*
* This transition sets the job state to "completed", records the completion timestamp,
* and stores the result of the job. Completed jobs will not be retried or processed again.
*
* This transition can only be applied to jobs that are currently running.
*/
declare class CompleteTransition extends JobTransition {
/** The result of the completed job. */
result?: unknown;
/**
* Creates a new CompleteTransition.
* @param result The result to store in the job.
*/
constructor(result?: unknown);
apply(job: JobData): JobData;
shouldRun(job: JobData): boolean;
}
export { CompleteTransition };