Skip to main content Link Search Menu Expand Document (external link)

Pool overview

Contextual wrapper for @effect/io/Pool

Added in v1.0.0


Table of contents


constructors

Pool

Construct a Pool implementation to be utilized from the Effect Context.

Signature

export declare function Pool<A, E>(): {
  <const I extends IdentifierFactory<any>>(identifier: I): Pool<IdentifierOf<I>, A, E>
  <const I>(identifier: I): Pool<IdentifierOf<I>, A, E>
}

Added in v1.0.0

models

Pool (interface)

Contextual wrapper for @effect/io/Pool

Signature

export interface Pool<I, A, E> extends Tag<I, P.Pool<A, E>> {
  readonly invalidate: (a: A) => Effect.Effect<void, never, I | Scope>
  readonly get: Effect.Effect<A, E, I | Scope>

  readonly make: <R>(options: {
    readonly acquire: Effect.Effect<A, E, R>
    readonly size: number
  }) => Layer.Layer<I, never, R>

  readonly makeWithTTL: <R>(options: {
    readonly acquire: Effect.Effect<A, E, R>
    readonly min: number
    readonly max: number
    readonly timeToLive: DurationInput
  }) => Layer.Layer<I, never, R>
}

Added in v1.0.0