| 1 | effect/StreamEmit#Emit: |
| 2 | replacement: "Queue.Queue<A, E | Cause.Done>" |
| 3 | note: "The StreamEmit module is gone; v4 Stream.callback hands the callback a Queue<A, E | Cause.Done> instead of an Emit function. Emit values with Queue.offer/Queue.offerAll, end with Queue.end, fail with Queue.fail/Queue.failCause." |
| 4 | example: | |
| 5 | // v3: Stream.async<number, Err>((emit) => { emit.single(1); emit.end() }) |
| 6 | Stream.callback<number, Err>((queue) => |
| 7 | Effect.gen(function*() { |
| 8 | yield* Queue.offer(queue, 1) |
| 9 | yield* Queue.end(queue) |
| 10 | })) |
| 11 | effect/StreamEmit#EmitOps: |
| 12 | replacement: "Queue.offer / Queue.offerAll / Queue.end / Queue.fail / Queue.failCause" |
| 13 | note: "Method-by-method mapping onto the Queue passed to Stream.callback: single(a) -> Queue.offer(queue, a); chunk(c) -> Queue.offerAll(queue, c); end() -> Queue.end(queue); fail(e) -> Queue.fail(queue, e); halt(cause) -> Queue.failCause(queue, cause); die(d)/dieMessage(m) -> Queue.failCause(queue, Cause.die(d)); done(exit) -> Queue.offer then Queue.end on success, Queue.failCause on failure; fromEffect(eff) -> run eff and offer its value (Effect.flatMap(eff, (a) => Queue.offer(queue, a)))." |
| 14 | effect/StreamEmit#EmitOpsPush: |
| 15 | replacement: "Queue.offerUnsafe / Queue.offerAllUnsafe / Queue.endUnsafe / Queue.failCauseUnsafe" |
| 16 | note: "The synchronous push interface of v3 Stream.asyncPush maps to the *Unsafe Queue operations on the Queue given to Stream.callback: single/array -> Queue.offerUnsafe/Queue.offerAllUnsafe, end -> Queue.endUnsafe, fail/halt/die -> Queue.failCauseUnsafe (wrap plain errors with Cause.fail, defects with Cause.die)." |