Concatenates with another stream in strict order
Allows a faster producer to progress independently of a slower consumer by buffering
up to capacity
chunks in a queue.
Allows a faster producer to progress independently of a slower consumer by buffering
up to capacity
chunks in a queue.
Prefer capacities that are powers of 2 for better performance.
Allows a faster producer to progress independently of a slower consumer by buffering elements into a dropping queue.
Allows a faster producer to progress independently of a slower consumer by buffering elements into a dropping queue.
Prefer capacities that are powers of 2 for better performance.
Allows a faster producer to progress independently of a slower consumer by buffering elements into a sliding queue.
Allows a faster producer to progress independently of a slower consumer by buffering elements into a sliding queue.
Prefer capacities that are powers of 2 for better performance.
Allows a faster producer to progress independently of a slower consumer by buffering elements into an unbounded queue.
Switches over to the stream produced by the provided function in case this one fails with a typed error.
Switches over to the stream produced by the provided function in case this one fails.
Switches over to the stream produced by the provided function in case this one fails. Allows recovery from all errors, except external interruption.
Collects a filtered, mapped subset of the stream.
Transforms all elements of the stream for as long as the specified partial function is defined.
Drops the specified number of elements from this stream.
Drops all elements of the stream until the specified predicate evaluates
to true
.
Drops all elements of the stream for as long as the specified predicate
evaluates to true
.
Returns a stream whose failures and successes have been lifted into an
Either
.
Returns a stream whose failures and successes have been lifted into an
Either
. The resulting stream cannot fail, because the failures have
been exposed as part of the Either
success case.
the stream will end as soon as the first error occurs.
Executes the provided finalizer after this stream's finalizers run.
Executes the provided finalizer before this stream's finalizers run.
Filters this stream by the specified predicate, retaining all elements for which the predicate evaluates to true.
Filters this stream by the specified effectful predicate, retaining all elements for which the predicate evaluates to true.
Filters this stream by the specified predicate, removing all elements for which the predicate evaluates to true.
Returns a stream made of the concatenation in strict order of all the streams
produced by passing each element of this stream to f0
Returns a stream made of the concatenation of all the chunks in this stream
Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type S
.
Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type S
.
See ZStream.fold
Executes an effectful fold over the stream of values.
Executes an effectful fold over the stream of values. See ZStream.foldM
Executes a pure fold over the stream of values.
Executes a pure fold over the stream of values. Returns a Managed value that represents the scope of the stream. See ZStream.foldManaged
Executes an effectful fold over the stream of values.
Executes an effectful fold over the stream of values. Returns a Managed value that represents the scope of the stream. See ZStream.foldManagedM
Reduces the elements in the stream to a value of type S
.
Reduces the elements in the stream to a value of type S
.
Stops the fold early when the condition is not fulfilled.
See ZStream.foldWhile
Executes an effectful fold over the stream of values.
Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. See ZStream.foldWhileM
Executes a pure fold over the stream of values.
Executes a pure fold over the stream of values. Stops the fold early when the condition is not fulfilled. See ZStream.foldWhileManaged
Executes an effectful fold over the stream of values.
Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. See ZStream.foldWhileManagedM
Consumes all elements of the stream, passing them to the specified callback.
Consumes elements of the stream, passing them to the specified callback,
and terminating consumption when the callback returns false
.
Returns a stream made of the elements of this stream transformed with f0
Statefully maps over the elements of this stream to produce new elements.
Statefully and effectfully maps over the elements of this stream to produce new elements.
Maps each element to an iterable and flattens the iterables into the output of this stream.
Maps each element to a chunk and flattens the chunks into the output of this stream.
Effectfully maps each element to a chunk and flattens the chunks into the output of this stream.
Effectfully maps each element to an iterable and flattens the iterables into the output of this stream.
Maps over elements of the stream with the specified effectful function.
Switches to the provided stream in case this one fails with a typed error.
Switches to the provided stream in case this one fails with a typed error.
See also ZStream#catchAll.
Provides the stream with its required environment, which eliminates
its dependency on R
.
An effectful version of provide
, useful when the act of provision
requires an effect.
Uses the given Managed to provide the environment required to run this stream, leaving no outstanding environments.
Provides some of the environment reuqired to run this effect,
leaving the remainder R0
.
Effectfully provides some of the environment required to run this effect
leaving the remainder R0
.
Uses the given Managed to provide some of the environment required to run
this stream, leaving the remainder R0
.
Runs the sink on the stream to produce either the sink's result or an error.
Takes the specified number of elements from this stream.
Takes all elements of the stream until the specified predicate evaluates
to true
.
Takes all elements of the stream for as long as the specified predicate
evaluates to true
.
Adds an effect to consumption of every element of the stream.
Converts the stream to a managed queue.
Converts the stream to a managed queue. After managed the queue is used, the queue will never again produce chunks and should be discarded.
Converts the stream into an unbounded managed queue.
Converts the stream into an unbounded managed queue. After the managed queue is used, the queue will never again produce values and should be discarded.
Converts the stream to a managed queue and immediately consume its elements.
Zips this stream together with the index of elements of the stream across chunks.
A
ZStreamChunk[R, E, A]
represents an effectful stream that can produce values of typeA
, or potentially fail with a value of typeE
.ZStreamChunk
differs fromZStream
in that elements in the stream are processed in batches, which is orders of magnitude more efficient than dealing with each element individually.ZStreamChunk
is particularly suited for situations where you are dealing with values of primitive types, e.g. those coming off ajava.io.InputStream