StreamEmit
Models
Signature
interface Emit<in R, in E, in A, out B> extends EmitOps<R, E, A, B> {
(f: Effect<Chunk<A>, Option<E>, R>): Promise<B>;
}Signature
interface EmitOps<in R, in E, in A, out B> {
chunk(chunk: Chunk<A>): Promise<B>;
die<Err>(defect: Err): Promise<B>;
dieMessage(message: string): Promise<B>;
done(exit: Exit<A, E>): Promise<B>;
end(): Promise<B>;
fail(error: E): Promise<B>;
fromEffect(effect: Effect<A, E, R>): Promise<B>;
fromEffectChunk(effect: Effect<Chunk<A>, E, R>): Promise<B>;
halt(cause: Cause<E>): Promise<B>;
single(value: A): Promise<B>;
}EmitOpsPush interface
Added in v3.6.0
Source
Signature
interface EmitOpsPush<in E, in A> {
array(chunk: readonly Array<A>): boolean;
chunk(chunk: Chunk<A>): boolean;
die<Err>(defect: Err): void;
dieMessage(message: string): void;
done(exit: Exit<A, E>): void;
end(): void;
fail(error: E): void;
halt(cause: Cause<E>): void;
single(value: A): boolean;
}
An
Emit<R, E, A, B>represents an asynchronous callback that can be called multiple times. The callback can be called with a value of typeEffect<Chunk<A>, Option<E>, R>, where succeeding with aChunk<A>indicates to emit those elements, failing withSome<E>indicates to terminate with that error, and failing withNoneindicates to terminate with an end of stream signal.