(seen: number)
| 380 | // Serialize entry and body pulls; reuse input pulled while waiting for the lock. |
| 381 | const lock = Semaphore.makeUnsafe(1) |
| 382 | const pullInput = (seen: number) => |
| 383 | lock.withPermit(Effect.suspend(() => pulls === seen ? pullUpstream : Effect.void)) |
| 384 | |
| 385 | const run = <A, D>(f: () => A | undefined | typeof NeedInput, end: () => D): Pull.Pull<A, TarError | IE, D> => |
| 386 | Effect.suspend(function loop(): Pull.Pull<A, TarError | IE, D> { |