@penkov/tasks_queue
Version:
A lightweight PostgreSQL-backed task queue system with scheduling, retries, backoff strategies, and priority handling. Designed for efficiency and observability in modern Node.js applications.
50 lines (49 loc) • 1.59 kB
TypeScript
/**
* Persisted orchestration metadata for the currently active child task of a
* {@link MultiStepPayload multi-step workflow}.
*/
export declare class ActiveChildState {
/**
* Persistent id of the spawned child task.
*/
readonly taskId: number;
/**
* Whether parent workflow may continue from `childFailed(...)` when this child
* reaches terminal `error`.
*
* This flag does not change the child task status itself.
*/
readonly allowFailure: boolean;
constructor(
/**
* Persistent id of the spawned child task.
*/
taskId: number,
/**
* Whether parent workflow may continue from `childFailed(...)` when this child
* reaches terminal `error`.
*
* This flag does not change the child task status itself.
*/
allowFailure?: boolean);
/**
* Create a shallow copy with selected fields replaced.
*
* @param o replacement fields
* @returns copied state with overrides applied
*/
copy(o: Partial<ActiveChildState>): ActiveChildState;
/**
* Serialize active child state into plain JSON for task payload persistence.
*
* @returns plain object suitable for embedding into {@link MultiStepPayload.toJson}
*/
get toJson(): object;
/**
* Deserialize active child state from plain JSON payload.
*
* @param j serialized active-child payload
* @returns parsed active-child state or `none` if the payload does not contain one
*/
static fromJson(j: unknown): import("scats").Option<ActiveChildState>;
}