UNPKG

@sidequest/engine

Version:

@sidequest/engine is the core engine of SideQuest, a distributed background job processing system for Node.js and TypeScript.

22 lines (19 loc) 787 B
import { Backend } from '@sidequest/backend'; import { JobData, JobTransition } from '@sidequest/core'; /** * Handles applying job transitions and updating jobs in the backend. */ declare class JobTransitioner { /** * Applies a transition to a job and updates it in the backend. * * This method checks if the transition should run based on the job's current state. * If applicable, it applies the transition and updates the job in the backend. * * @param jobData The job data to update. * @param transition The job transition to apply. * @returns A promise resolving to the updated job data. */ static apply(backend: Backend, jobData: JobData, transition: JobTransition): JobData | Promise<JobData>; } export { JobTransitioner };