Immediately terminate the transport, permenantly putting it into an error state
Immediately terminate the transport, permenantly putting it into an error state
Link this source to a sink.
Link this source to a sink. Items will be pulled from the source and pushed to the sink, respecting backpressure, until either the source is closed or an error occurs. The sink will be closed when this source is closed. If the sink is closed before this source, this source will be terminated. Other terminations are propagated in both directions.
The sink to link to this source
if true, the linked sink will be closed when this source is closed
if true, the linked sink will be terminated when this source is terminated
Pull until either the supplied function returns false or there are no more
items immediately available to pull, in which case a Some[NullPullResult]
is returned indicating why the loop stopped.
Pull until either the supplied function returns false or there are no more
items immediately available to pull, in which case a Some[NullPullResult]
is returned indicating why the loop stopped.
A Pipe is a callback-based data transport abstraction meant for handling streams. It provides backpressure feedback for both the write and read ends.
Pipes are primarily a way to easily process incoming/outgoing streams and manage backpressure. A Producer pushes items into a pipe and a consumer pulls them out. Pulling is done through the use of a callback function which the Pipe holds onto until an item is pushed. Each call to
pull
will only ever pull one item out of the pipe, so generally the consumer enters a loop by calling pull within the callback function.Backpressure is handled differently for the producer and consumer. In effect, the consumer is the "leader" in terms of backpressure, since the consumer must always ask for more items. For the producer, the return value of
push
will indicate if backpressure is occurring. When the pipe is "full",push
returns aTrigger
, which the producer "fills" by supplying a callback function. This function will be called once the backpressure has been alleviated and the pipe can accept more items.