Hyperlinkv0.9.0-beta.0

WorkPool

WorkPool.WorkPoolConfigWithItemSchematypesrc/internal/workPool.ts:1143
WorkPoolConfigWithItemSchema<T, E, R, A>

A WorkPool config that carries an explicit itemSchema (typed items over the wire).

modelsWorkPool
export type WorkPoolConfigWithItemSchema<T, E, R, A = void> = WorkPoolConfigBase<T> & {
  readonly itemSchema: Schema.Codec<T, unknown, never, never>;
  /**
   * Daemon each item. The **success channel `A`** is driven by the tag's `success` wire schema
   * (default `void`): with a `success` schema the worker must return `Effect<A, E, R>` and that
   * value rides `Completed.success` / `store.completed`; without one it stays `Effect<void, E, R>`.
   */
  readonly effect: (item: T, ctx: EffectContext<T, QueueEnqueueErrors, R>) => Effect.Effect<A, E, R>;
  /** Optional inline per-error disposition. See {@link QueueOnFailure}. */
  readonly onFailure?: QueueOnFailure<T, E, R>;
  /** Optional self-refill from a source on start / drain. See {@link QueueRefill}. */
  readonly refill?: QueueRefill<T, E, QueueEnqueueErrors, R, A>;
  /**
   * Internal store recorder — the engine records each published event through its narrow, semantic
   * writes ({@link QueueStoreWriter}) at the source (`publishEvent`) so no burst is dropped by a late
   * `Stream.fromPubSub` subscription. Wired by `WorkPool.layer` from the baked-in store. @internal
   */
  readonly store?: QueueStoreWriter<T, E, A>;
};
Referenced by 3 symbols