(
self: Stream<A, E, R>,
f: (
pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void, R>,
scope: Scope.Scope,
forkedScope: Scope.Scope
) => Effect.Effect<
Pull.Pull<Arr.NonEmptyReadonlyArray<B>, E2, void, R2>,
EX,
RX
>
)
| 691 | * @category constructors |
| 692 | * @since 4.0.0 |
| 693 | */ |
| 694 | export const callback = <A, E = never, R = never>( |
| 695 | f: (queue: Queue.Queue<A, E | Cause.Done>) => Effect.Effect<unknown, E, R | Scope.Scope>, |
| 696 | options?: { |
| 697 | readonly bufferSize?: number | undefined |
| 698 | readonly strategy?: "sliding" | "dropping" | "suspend" | undefined |
| 699 | } |
| 700 | ): Stream<A, E, Exclude<R, Scope.Scope>> => fromChannel(Channel.callbackArray(f, options)) |
| 701 | |
| 702 | /** |
| 703 | * Creates an empty stream. |
| 704 | * |
| 705 | * **Example** (Creating an empty stream) |
| 706 | * |
| 707 | * ```ts import.meta.vitest |
| 708 | * import { Effect, Stream } from "effect" |
| 709 | * |
| 710 | * await Effect.runPromise(Stream.runCollect(Stream.empty)) // => [] |
| 711 | * ``` |
| 712 | * |
no test coverage detected
searching dependent graphs…