(options: {
readonly acquire: Effect.Effect<A, E, R>
readonly min: number
readonly max: number
readonly concurrency?: number | undefined
readonly targetUtilization?: number | undefined
readonly timeToLive: Duration.Input
readonly timeToLiveStrategy?: "creation" | "usage" | undefined
})
| 285 | * @since 2.0.0 |
| 286 | */ |
| 287 | export const makeWithTTL = <A, E, R>(options: { |
| 288 | readonly acquire: Effect.Effect<A, E, R> |
| 289 | readonly min: number |
| 290 | readonly max: number |
| 291 | readonly concurrency?: number | undefined |
| 292 | readonly targetUtilization?: number | undefined |
| 293 | readonly timeToLive: Duration.Input |
| 294 | readonly timeToLiveStrategy?: "creation" | "usage" | undefined |
| 295 | }): Effect.Effect<Pool<A, E>, never, R | Scope.Scope> => |
| 296 | Effect.flatMap( |
| 297 | options.timeToLiveStrategy === "creation" ? |
| 298 | strategyCreationTTL<A, E>(options.timeToLive) : |
| 299 | strategyUsageTTL<A, E>(options.timeToLive), |
| 300 | (strategy) => makeWithStrategy({ ...options, strategy }) |
| 301 | ) |
| 302 | |
| 303 | /** |
| 304 | * Creates a scoped pool using a custom resizing and reclamation strategy. |
nothing calls this directly
no test coverage detected