A feed is called to advance the pipe: with a Task to obtain a new feed carrying the transformed items, or
with a Sink to consume it and obtain the final result. A caller preferring to drive the pipe itself iterates
the feed with for await. Composition is lazy, as nothing is drawn from the source until a sink or an iteration
consumes the feed.
A feed ends when the source it draws from stops yielding items: an array, a generator object or another feed ends it
on its own under the
iteration protocols.
A source producing one value per call, a polling function for instance, is bounded by the feed it is opened with,
either reporting an end marker as inlet accepts or wrapped in a generator of its own, while a
source genuinely without end is bounded downstream, with a task such as take or with a sink
deciding its outcome early.
A feed is replayable only as far as its source is: one opened over a repeatable source, an array or a set among
them, carries the same items at each pass, while one opened over a source drained by iteration is empty after the
first. A feed handed to a Task or a Sink, and one a task reports, is drained by a single pass
whatever it draws from, so a pipe is replayed by composing it afresh from the feed it opens with.
Async sequence of items.
A feed is called to advance the pipe: with a Task to obtain a new feed carrying the transformed items, or with a Sink to consume it and obtain the final result. A caller preferring to drive the pipe itself iterates the feed with
for await. Composition is lazy, as nothing is drawn from the source until a sink or an iteration consumes the feed.A feed ends when the source it draws from stops yielding items: an array, a generator object or another feed ends it on its own under the iteration protocols. A source producing one value per call, a polling function for instance, is bounded by the feed it is opened with, either reporting an end marker as inlet accepts or wrapped in a generator of its own, while a source genuinely without end is bounded downstream, with a task such as take or with a sink deciding its outcome early.
A feed is replayable only as far as its source is: one opened over a repeatable source, an array or a set among them, carries the same items at each pass, while one opened over a source drained by iteration is empty after the first. A feed handed to a Task or a Sink, and one a task reports, is drained by a single pass whatever it draws from, so a pipe is replayed by composing it afresh from the feed it opens with.
See
ECMAScript AsyncIterator interface