MCPcopy Create free account
hub / github.com/effect-app/libs / process

Function process

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

Source from the content-addressed store, hash-verified

622 const ttlMillis = Duration.toMillis(Duration.fromInputUnsafe(ttl))
623 const creationTimes = new WeakMap<PoolItem<A, E>, number>()
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(

Callers 1

codeFilter3__Function · 0.50

Calls 4

invalidatePoolItemFunction · 0.85
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…