(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
})
| 353 | * @since 2.0.0 |
| 354 | */ |
| 355 | export const makeWithTTL = <A, E, R>(options: { |
| 356 | readonly acquire: Effect.Effect<A, E, R> |
| 357 | readonly min: number |
| 358 | readonly max: number |
| 359 | readonly concurrency?: number | undefined |
| 360 | readonly targetUtilization?: number | undefined |
| 361 | readonly timeToLive: Duration.Input |
| 362 | readonly timeToLiveStrategy?: "creation" | "usage" | undefined |
| 363 | }): Effect.Effect<Pool<A, E>, never, R | Scope.Scope> => |
| 364 | Effect.flatMap( |
| 365 | options.timeToLiveStrategy === "creation" ? |
| 366 | strategyCreationTTL<A, E>(options.timeToLive) : |
| 367 | strategyUsageTTL<A, E>(options.timeToLive), |
| 368 | (strategy) => makeWithStrategy({ ...options, strategy }) |
| 369 | ) |
| 370 | |
| 371 | /** |
| 372 | * Creates a scoped pool using a custom resizing and reclamation strategy. |
nothing calls this directly
no test coverage detected