Waits for a chunk of elements to be available in the source stream.
Waits for a chunk of elements to be available in the source stream. The chunk of elements along with a new handle are provided as the resource of the returned pull. The new handle can be used for subsequent operations, like awaiting again.
Like await but waits for a single element instead of an entire chunk.
Like awaitAsync but waits for a single element instead of an entire chunk.
Awaits the next available element from the input, or None
if the input is exhausted.
Asynchronously awaits for a chunk of elements to be available in the source stream.
Asynchronously awaits for a chunk of elements to be available in the source stream. An async step is returned as the resource of the returned pull. The async step is a ScopedFuture, which can be raced with another scoped future or forced via ScopedFuture#pull.
Like await, but returns a NonEmptyChunk
of no more than maxChunkSize
elements.
Returns a List[NonEmptyChunk[A]]
from the input whose combined size has a maximum value n
.
Awaits the next available chunk from the input, or None
if the input is exhausted.
Copies the next available chunk to the output.
Copies the next available element to the output.
Converts this handle to a handle of the specified subtype.
Drops the first n
elements of this Handle
, and returns the new Handle
.
Drops elements of the this Handle
until the predicate p
fails, and returns the new Handle
.
Drops elements of the this Handle
until the predicate p
fails, and returns the new Handle
.
If non-empty, the first element of the returned Handle
will fail p
.
Writes all inputs to the output of the returned Pull
.
Reads a single element from the input and emits it to the output.
Reads a single element from the input and emits it to the output. Returns the new Handle
.
Reads the next available chunk from the input and emits it to the output.
Reads the next available chunk from the input and emits it to the output. Returns the new Handle
.
Like awaitN
, but leaves the buffered input unconsumed.
Awaits the next available element where the predicate returns true.
Folds all inputs using an initial value z
and supplied binary operator, and writes the final
result to the output of the supplied Pull
when the stream has no more values.
Folds all inputs using the supplied binary operator, and writes the final result to the output of
the supplied Pull
when the stream has no more values.
Writes a single true
value if all input matches the predicate, false
otherwise.
Returns the last element of the input, if non-empty.
Applies f
to each element from the source stream, yielding a new handle with a potentially different element type.
Like await but does not consume the chunk (i.e., the chunk is pushed back).
Like await1 but does not consume the element (i.e., the element is pushed back).
Like await, but runs the await
asynchronously.
Like await, but runs the await
asynchronously. A flatMap
into
inner Pull
logically blocks until this await completes.
Returns a new handle with the specified chunk prepended to elements from the source stream.
Like push but for a single element instead of a chunk.
Emits the first n
elements of the input and return the new Handle
.
Emits the last n
elements of the input.
Like takeWhile
, but emits the first value which tests false.
Emits the elements of this Handle
until the predicate p
fails,
and returns the new Handle
.
Emits the elements of this Handle
until the predicate p
fails,
and returns the new Handle
. If non-empty, the returned Handle
will have
a first element i
for which p(i)
is false
.
A currently open
Stream[F,A]
which allows chunks to be pulled or pushed.To get a handle from a stream, use Stream.open.