@workglow/ai 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,12 @@ export declare class QueuedExecutionStrategy implements IAiExecutionStrategy {
28
28
  * within the same strategy instance share a single queue-creation flow.
29
29
  */
30
30
  private initPromise;
31
+ /**
32
+ * Shared limiter used by both the underlying JobQueueServer (for `execute`)
33
+ * and `executeStream` below. Created lazily in createQueue() and reused so
34
+ * streaming calls compete for the same concurrency slots as queued jobs.
35
+ */
36
+ private limiter;
31
37
  constructor(queueName: string, concurrency?: number,
32
38
  /**
33
39
  * When false, the strategy will use a pre-registered queue and throw if
@@ -37,13 +43,16 @@ export declare class QueuedExecutionStrategy implements IAiExecutionStrategy {
37
43
  execute(jobInput: AiJobInput<TaskInput>, context: IExecuteContext, runnerId: string | undefined): Promise<TaskOutput>;
38
44
  abort(): void;
39
45
  /**
40
- * Streaming execution for queued providers. Because the job queue does not
41
- * support streaming outputs, this method routes through `execute()` so that
42
- * GPU serialization is preserved, then yields a single `finish` event with
43
- * the result. Callers that need true token-by-token streaming should use a
44
- * DirectExecutionStrategy provider instead.
46
+ * Streaming execution for queued providers. Runs the provider's stream
47
+ * function directly (bypassing the storage-backed queue, which can't
48
+ * forward mid-stream events) while still acquiring a slot from the same
49
+ * concurrency limiter the queue uses so GPU serialization is preserved.
50
+ *
51
+ * AiJob.executeStream handles worker-proxy lookup, abort wiring, timeouts,
52
+ * and error classification; we just gate it through the limiter.
45
53
  */
46
54
  executeStream(jobInput: AiJobInput<TaskInput>, context: IExecuteContext, runnerId: string | undefined): AsyncIterable<StreamEvent<TaskOutput>>;
55
+ private acquireLimiterSlot;
47
56
  private ensureQueue;
48
57
  private createQueue;
49
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"QueuedExecutionStrategy.d.ts","sourceRoot":"","sources":["../../src/execution/QueuedExecutionStrategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAU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