Hyperlinkv0.9.0-beta.0

WorkPool

WorkPool.configurefunctionsrc/WorkPool.ts:2214
<
  Self,
  F extends QueueItemFields = QueueItemFields,
  R = never,
  RR = never,
  Success extends Schema.Top = Schema.Void,
  Error extends Schema.Top = Schema.Never
>(
  tag: QueueTagFor<Self, F, Success, Error>,
  patch: ConfigPatch<
    QueueVerbConfig<F, QueueErrorValueOf<Error>, R, RR, Success>
  >
): Layer.Layer<never>
<
  Self,
  F extends PriorityItemFields = PriorityItemFields,
  E = never,
  R = never,
  RR = never
>(
  tag: HyperlinkTag<Self, PriorityInstanceSpec<F>>,
  patch: ConfigPatch<
    PriorityLayerConfig<Schema.Struct<F>["Type"], E, R, RR>
  >
): Layer.Layer<never>

A config-patch layer for the WorkPool tag — the toolkit successor to the old WorkPool.Service(...).configure(...). Merge it with the queue's layer (e.g. per environment) and its patch (concurrency / rateLimit / attempts / …) folds onto the layer's base config at build. Keyed by tag.key; later patches win. Config lives in the layer, not the tag, so configure takes the tag and returns a layer rather than being a tag method.

const Prod = Layer.mergeAll(
  WorkPool.layer(MyQueue, { effect }),
  WorkPool.configure(MyQueue, { concurrency: 3, rateLimit: { window: "1 second", limit: 5 } }),
);
layers & servinglayer
Source src/WorkPool.ts:221427 lines
export function configure<
  Self,
  F extends QueueItemFields = QueueItemFields,
  R = never,
  RR = never,
  Success extends Schema.Top = typeof Schema.Void,
  Error extends Schema.Top = typeof Schema.Never,
>(
  tag: QueueTagFor<Self, F, Success, Error>,
  patch: ConfigPatch<QueueVerbConfig<F, QueueErrorValueOf<Error>, R, RR, Success>>,
): Layer.Layer<never>;
export function configure<
  Self,
  F extends PriorityItemFields = PriorityItemFields,
  E = never,
  R = never,
  RR = never,
>(
  tag: HyperlinkTag<Self, PriorityInstanceSpec<F>>,
  patch: ConfigPatch<PriorityLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>,
): Layer.Layer<never>;
export function configure(
  tag: AnyPoolTag,
  patch: ConfigPatch<unknown>,
): Layer.Layer<never> {
  return configureLayer(tag.key, patch);
}