mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-27 04:39:30 +00:00
22 lines
824 B
TypeScript
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>;
|