(seen: number)
| 421 | // Serialize entry and body pulls; reuse input pulled while waiting for the lock. |
| 422 | const lock = Semaphore.makeUnsafe(1) |
| 423 | const pullInput = (seen: number) => |
| 424 | lock.withPermit(Effect.suspend(() => pulls === seen ? pullUpstream : Effect.void)) |
| 425 | |
| 426 | const run = <A, D>(f: () => A | undefined | typeof NeedInput, end: () => D): Pull.Pull<A, ZipError | IE, D> => |
| 427 | Effect.suspend(function loop(): Pull.Pull<A, ZipError | IE, D> { |