API · Flow
makeAsync()
Periodically yield a long synchronous pipeline to the next event-loop turn.
Signature
makeAsync(maxSyncExecutionTime: number): Exstream<T, C> Example
const responsive = exstream(largeArray).map(expensiveTransform).makeAsync(8) Parameters
maxSyncExecutionTimeApproximate milliseconds of continuous synchronous delivery allowed before a value is deferred to the next turn. Zero yields after timing advances beyond the initial snapshot.
Behavior
Values, order, and contexts are unchanged. Once elapsed monotonic time exceeds the budget, the current value is scheduled for the next turn and upstream waits for its completion. This makes the pipeline asynchronous and creates a cooperative scheduling boundary; it does not run work in a worker or parallel thread.
Only one deferred turn is pending, so the operator adds constant buffering and respects pressure. Existing record errors pass through. Ending or destroying the branch cancels a scheduled turn.
Errors
Negative values, NaN, and Infinity are rejected when the operator is created. The JavaScript runtime coerces numeric strings, while TypeScript accepts numbers.
Forms
stream.makeAsync(8)
exstream.pipeline().makeAsync(8)
exstream.makeAsync(8, stream)
stream.through(exstream.makeAsync(8))