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

Function process

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

Source from the content-addressed store, hash-verified

1214 return identity<Strategy<A, E>>({
1215 run: (pool) => {
1216 const process = (item: PoolItem<A, E>): Effect.Effect<void> =>
1217 Effect.suspend(() => {
1218 if (!pool.state.items.has(item) || pool.state.invalidated.has(item)) {
1219 return Effect.void
1220 }
1221 const now = clock.currentTimeMillisUnsafe()
1222 const created = creationTimes.get(item)!
1223 const remaining = ttlMillis - (now - created)
1224 return remaining > 0
1225 ? Effect.delay(process(item), remaining)
1226 : invalidatePoolItem(pool, item)
1227 })
1228 return Queue.take(queue).pipe(
1229 Effect.tap(process),
1230 Effect.forever({ disableYield: true })

Callers

nothing calls this directly

Calls 4

invalidatePoolItemFunction · 0.85
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected