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

Function process

packages/effect/src/Pool.ts:626–637  ·  view source on GitHub ↗
(item: PoolItem<A, E>)

Source from the content-addressed store, hash-verified

624 return identity<Strategy<A, E>>({
625 run: (pool) => {
626 const process = (item: PoolItem<A, E>): Effect.Effect<void> =>
627 Effect.suspend(() => {
628 if (!pool.state.items.has(item) || pool.state.invalidated.has(item)) {
629 return Effect.void
630 }
631 const now = clock.currentTimeMillisUnsafe()
632 const created = creationTimes.get(item)!
633 const remaining = ttlMillis - (now - created)
634 return remaining > 0
635 ? Effect.delay(process(item), remaining)
636 : invalidatePoolItem(pool, item)
637 })
638 return Queue.take(queue).pipe(
639 Effect.tap(process),
640 Effect.forever({ disableYield: true })

Callers

nothing calls this directly

Calls 4

invalidatePoolItemFunction · 0.85
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected