clyops Node API
    Preparing search index...

    Class JobQueue<R>

    An in-memory queue with bounded concurrency and retention. Await each job.done to observe its result.

    Type Parameters

    • R = unknown
    Index
    • Queue task as a job of functionName. The task gets an AbortSignal and a stage setter for progress; its return value is the job's result.

      Parameters

      • functionName: string
      • task: (ctx: { signal: AbortSignal; stage: (stage: string) => void }) => Promise<R>
      • fields: Record<string, unknown> = {}

      Returns Job<R>

    • Look up a retained job by ID; returns undefined when unknown or dropped.

      Parameters

      • id: string

      Returns Job<R> | undefined