LayerConfig<I, A, E, R>Layer / serve config — the tag carries wire schemas; this supplies the gated effect.
export interface interface LayerConfig<I, A, E, R>Layer / serve config — the tag carries wire schemas; this supplies the gated effect.
LayerConfig<function (type parameter) I in LayerConfig<I, A, E, R>I, function (type parameter) A in LayerConfig<I, A, E, R>A, function (type parameter) E in LayerConfig<I, A, E, R>E, function (type parameter) R in LayerConfig<I, A, E, R>R> {
/** Override telemetry / status `resourceId`; defaults to the tag key. */
readonly LayerConfig<I, A, E, R>.name?: string | undefinedOverride telemetry / status resourceId; defaults to the tag key.
name?: string;
/** Unit gates may pass a bare effect; parameterized gates use `(input) => Effect`. */
readonly LayerConfig<I, A, E, R>.effect: LayerEffect<I, A, E, R>Unit gates may pass a bare effect; parameterized gates use (input) => Effect.
effect: type LayerEffect<I, A, E, R> = [
I
] extends [void]
?
| Effect.Effect<A, E, R>
| (() => Effect.Effect<A, E, R>)
: (input: I) => Effect.Effect<A, E, R>
Gated effect for
layer
/
serve
— unit gates (void input) accept a bare
Effect.Effect
or () => Effect; parameterized gates use (input) => Effect.
LayerEffect<function (type parameter) I in LayerConfig<I, A, E, R>I, function (type parameter) A in LayerConfig<I, A, E, R>A, function (type parameter) E in LayerConfig<I, A, E, R>E, function (type parameter) R in LayerConfig<I, A, E, R>R>;
/**
* Max concurrent executions through this gate.
* @default 1
*/
readonly LayerConfig<I, A, E, R>.concurrency?: number | undefinedMax concurrent executions through this gate.
concurrency?: number;
/**
* Optional Effect `RateLimiter` on each `run` (before the concurrency semaphore).
* Omitted = no rate limit (only {@link concurrency}).
*/
readonly LayerConfig<I, A, E, R>.rateLimit?: RateLimitOptionsOptional Effect RateLimiter on each run (before the concurrency semaphore).
Omitted = no rate limit (only
concurrency
).
rateLimit?: type RateLimitOptions = Omit<
{
readonly algorithm?:
| "fixed-window"
| "token-bucket"
| undefined
readonly onExceeded?:
| "delay"
| "fail"
| undefined
readonly window: Input
readonly limit: number
readonly key: string
readonly tokens?: number | undefined
},
"key"
> & {
readonly key?: internal.RateLimiterConsumeOptions["key"]
}
Effect RateLimiter.consume / makeWithRateLimiter options for a gate
(key optional — defaults to the gate hyperlink / tag id). Policy only; the
RateLimiter / RateLimiterStore services are presence-driven in Context.
RateLimitOptions;
}