Files
openclaw/src/process/command-queue.types.ts
2026-06-19 00:20:49 +08:00

22 lines
824 B
TypeScript

/**
* Public enqueue knobs shared by command-lane callers and narrower injection
* points that should not import the full queue implementation.
*/
export type CommandQueueEnqueueOptions = {
warnAfterMs?: number;
onWait?: (waitMs: number, queuedAhead: number) => void;
taskTimeoutMs?: number;
taskTimeoutProgressAtMs?: () => number | undefined;
taskTimeoutAbortSignal?: AbortSignal;
taskTimeoutAbortGraceMs?: number;
/** Ends the task after a caller-owned timeout cleanup grace has already elapsed. */
taskTimeoutReleaseSignal?: AbortSignal;
priority?: "foreground" | "normal" | "background";
};
/** Minimal queue function contract used by code that only needs to schedule work. */
export type CommandQueueEnqueueFn = <T>(
task: () => Promise<T>,
opts?: CommandQueueEnqueueOptions,
) => Promise<T>;