Skip to content

TypeScript API / contentia/core / ContentiaStream / make

Function: make() ​

ts
function make<A, D, R>(build, options?): ContentiaStream<A, D, R>;

Generator-style builder for arbitrary ContentiaStreams. The builder receives an emit API and returns an Effect that resolves to the typed done value.

The builder's Effect runs concurrently with the consumer: emissions land in a bounded queue, the consumer pulls chunks as they're ready, and when the builder completes the queue terminates with the done value as its Done leftover.

Type Parameters ​

Type ParameterDefault type
A-
D extends ContentiaDone-
Rnever

Parameters ​

ParameterType
build(emit) => Effect<D, ContentiaError<ErrorCode, number>, R>
options?{ capacity?: number; }
options.capacity?number

Returns ​

ContentiaStream<A, D, R>