/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IExecuteContext, TaskInput, TaskOutput } from "@workglow/task-graph"; import type { AiEmit } from "../capability/AiEmit"; import type { AiJobInput } from "../job/AiJob"; import type { IAiExecutionStrategy } from "./IAiExecutionStrategy"; /** * Queued execution: acquires a slot from a shared {@link ConcurrencyLimiter} * so GPU-serialized providers (HFT WebGPU, LlamaCpp) don't run more than the * configured concurrency in parallel. Releases the slot when the job * completes. * * Unlike the previous implementation, this strategy does **not** use a * storage-backed JobQueue. The new run-fn shape emits events through the * dispatch chain; storage queues can't carry mid-stream events. If * retry/persistence semantics are needed for a particular provider, that's * a separate strategy added later — this one is for in-task concurrency * control only. */ export declare class QueuedExecutionStrategy implements IAiExecutionStrategy { private readonly concurrency; private limiter; /** * @param concurrency Maximum number of in-flight jobs across the shared * limiter. */ constructor(concurrency?: number); execute(jobInput: AiJobInput, context: IExecuteContext, runnerId: string | undefined, emit: AiEmit): Promise; abort(): void; /** * Atomically acquire a limiter slot, retrying with backoff until success or * abort. Uses {@link ILimiter.tryAcquire} so concurrent callers cannot both * pass a check-then-record sequence and overshoot the configured limit. */ private acquireLimiterSlot; } //# sourceMappingURL=QueuedExecutionStrategy.d.ts.map