(item: PoolItem<A, E>)
| 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 }) |
nothing calls this directly
no test coverage detected