MCPcopy Create free account
hub / github.com/Effect-TS/effect / get

Function get

packages/effect/src/Pool.ts:423–429  ·  view source on GitHub ↗
(self: Pool<A, E>)

Source from the content-addressed store, hash-verified

421 * @since 2.0.0
422 */
423export const get = <A, E>(self: Pool<A, E>): Effect.Effect<A, E, Scope.Scope> =>
424 Effect.suspend(() => {
425 if (self.state.isShuttingDown) {
426 return Effect.interrupt
427 }
428 return Effect.flatMap(getPoolItem(self), (item) => item.exit)
429 })
430
431const getPoolItem = <A, E>(self: Pool<A, E>): Effect.Effect<PoolItem<A, E>, never, Scope.Scope> =>
432 Effect.uninterruptibleMask((restore) =>

Callers

nothing calls this directly

Calls 1

getPoolItemFunction · 0.85

Tested by

no test coverage detected