A ZPipeline[Env, Err, In, Out] is a polymorphic stream transformer. Pipelines accept a stream as input, and return the transformed stream as output.
Pipelines can be thought of as a recipe for calling a bunch of methods on a source stream, to yield a new (transformed) stream. A nice mental model is the following type alias:
type ZPipeline[Env, Err, In, Out] = ZStream[Env, Err, In] => ZStream[Env, Err, Out]
This encoding of a pipeline with a type alias is not used because it does not infer well. In its place, this trait captures the polymorphism inherent to many pipelines, which can therefore be more flexible about the environment and error types of the streams they transform.
There is no fundamental requirement for pipelines to exist, because everything pipelines do can be done directly on a stream. However, because pipelines separate the stream transformation from the source stream itself, it becomes possible to abstract over stream transformations at the level of values, creating, storing, and passing around reusable transformation pipelines that can be applied to many different streams.
The most common way to create a pipeline is to convert a sink into a pipeline (in general, transforming elements of a stream requires the power of a sink). However, the companion object has lots of other pipeline constructors based on the methods of stream.
Attributes
- Companion
- object
- Source
- ZPipeline.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Members list
Value members
Concrete methods
Composes two pipelines into one pipeline, by first applying the transformation of the specified pipeline, and then applying the transformation of this pipeline.
Composes two pipelines into one pipeline, by first applying the transformation of the specified pipeline, and then applying the transformation of this pipeline.
Attributes
- Source
- ZPipeline.scala
Composes two pipelines into one pipeline, by first applying the transformation of this pipeline, and then applying the transformation of the specified pipeline.
Composes two pipelines into one pipeline, by first applying the transformation of this pipeline, and then applying the transformation of the specified pipeline.
Attributes
- Source
- ZPipeline.scala
Compose this pipeline with a sink, resulting in a sink that processes elements by piping them through this pipeline and piping the results into the sink.
Compose this pipeline with a sink, resulting in a sink that processes elements by piping them through this pipeline and piping the results into the sink.
Attributes
- Source
- ZPipeline.scala
Aggregates elements of this stream using the provided sink for as long as the downstream operators on the stream are busy.
Aggregates elements of this stream using the provided sink for as long as the downstream operators on the stream are busy.
This operator divides the stream into two asynchronous "islands". Operators upstream of this operator run on one fiber, while downstream operators run on another. Whenever the downstream fiber is busy processing elements, the upstream fiber will feed elements into the sink until it signals completion.
Any sink can be used here, but see ZSink.foldWeightedZIO and ZSink.foldUntilZIO for sinks that cover the common usecases.
Attributes
- Source
- ZPipeline.scala
Like aggregateAsyncWithinEither, but only returns the Right results.
Like aggregateAsyncWithinEither, but only returns the Right results.
Attributes
- Source
- ZPipeline.scala
Aggregates elements using the provided sink until it completes, or until the delay signalled by the schedule has passed.
Aggregates elements using the provided sink until it completes, or until the delay signalled by the schedule has passed.
This operator divides the stream into two asynchronous islands. Operators upstream of this operator run on one fiber, while downstream operators run on another. Elements will be aggregated by the sink until the downstream fiber pulls the aggregated value, or until the schedule's delay has passed.
Aggregated elements will be fed into the schedule to determine the delays between pulls.
Attributes
- Source
- ZPipeline.scala
A named version of the >>> operator.
Attach this pipeline to the given stream
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using natural equality to determine whether two elements are equal.
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using natural equality to determine whether two elements are equal.
Attributes
- Source
- ZPipeline.scala
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using the specified function to determine whether two elements are equal.
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using the specified function to determine whether two elements are equal.
Attributes
- Source
- ZPipeline.scala
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using the specified effectual function to determine whether two elements are equal.
Returns a new pipeline that only emits elements that are not equal to the previous element emitted, using the specified effectual function to determine whether two elements are equal.
Attributes
- Source
- ZPipeline.scala
Exposes the underlying chunks of the stream as a stream of chunks of elements.
Exposes the underlying chunks of the stream as a stream of chunks of elements.
Attributes
- Source
- ZPipeline.scala
Performs a filter and map in a single step.
Filters any Right values.
Filters any Left values.
Filters any 'None' values.
Filters any Exit.Failure values.
Transforms all elements of the pipeline for as long as the specified partial function is defined.
Transforms all elements of the pipeline for as long as the specified partial function is defined.
Attributes
- Source
- ZPipeline.scala
Terminates the pipeline when encountering the first Right.
Terminates the pipeline when encountering the first Left.
Terminates the pipeline when encountering the first None.
Terminates the pipeline when encountering the first Exit.Failure.
Effectfully transforms all elements of the pipeline for as long as the specified partial function is defined.
Effectfully transforms all elements of the pipeline for as long as the specified partial function is defined.
Attributes
- Source
- ZPipeline.scala
A named version of the <<< operator.
Returns a new pipeline which is the same as this one but applies the given function to the pipeline's input.
Returns a new pipeline which is the same as this one but applies the given function to the pipeline's input.
Attributes
- Source
- ZPipeline.scala
Transforms the input and output types of this pipeline using the specified functions.
Transforms the input and output types of this pipeline using the specified functions.
Attributes
- Source
- ZPipeline.scala
Converts this pipeline to a pipeline that executes its effects but emits no elements. Useful for sequencing effects using pipeline:
Converts this pipeline to a pipeline that executes its effects but emits no elements. Useful for sequencing effects using pipeline:
(Stream(1, 2, 3).tap(i => ZIO(println(i))) ++
(Stream.fromZIO(ZIO(println("Done!"))) >>> ZPipeline.drain) ++
Stream(4, 5, 6).tap(i => ZIO(println(i)))).run(Sink.drain)
Attributes
- Source
- ZPipeline.scala
Drops the specified number of elements from this stream.
Drops the last specified number of elements from this pipeline.
Drops the last specified number of elements from this pipeline.
Attributes
- Note
-
This combinator keeps
nelements in memory. Be careful with big numbers. - Source
- ZPipeline.scala
Drops all elements of the pipeline until the specified predicate evaluates to true.
Drops all elements of the pipeline until the specified predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Drops incoming elements until the effectful predicate p is satisfied.
Drops incoming elements until the effectful predicate p is satisfied.
Attributes
- Source
- ZPipeline.scala
Drops all elements of the pipeline for as long as the specified predicate evaluates to true.
Drops all elements of the pipeline for as long as the specified predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Drops incoming elements as long as the effectful predicate p is satisfied.
Drops incoming elements as long as the effectful predicate p is satisfied.
Attributes
- Source
- ZPipeline.scala
Filters the elements emitted by this pipeline using the provided function.
Filters the elements emitted by this pipeline using the provided function.
Attributes
- Source
- ZPipeline.scala
Effectfully filters the elements emitted by this pipeline.
Submerges the chunks carried by this pipeline into the pipeline's structure, while still preserving them.
Submerges the chunks carried by this pipeline into the pipeline's structure, while still preserving them.
Attributes
- Source
- ZPipeline.scala
Flattens Exit values. Exit.Failure values translate to pipeline failures while Exit.Success values translate to stream elements.
Flattens Exit values. Exit.Failure values translate to pipeline failures while Exit.Success values translate to stream elements.
Attributes
- Source
- ZPipeline.scala
Submerges the iterables carried by this pipeline into the pipeline's structure, while still preserving them.
Submerges the iterables carried by this pipeline into the pipeline's structure, while still preserving them.
Attributes
- Source
- ZPipeline.scala
Flattens take values.
Partitions the pipeline with specified chunkSize
Partitions the pipeline with specified chunkSize
Value parameters
- chunkSize
-
size of the chunk
Attributes
- Source
- ZPipeline.scala
Partitions the stream with the specified chunkSize or until the specified duration has passed, whichever is satisfied first.
Partitions the stream with the specified chunkSize or until the specified duration has passed, whichever is satisfied first.
Attributes
- Source
- ZPipeline.scala
Intersperse pipeline with provided element similar to List.mkString.
Intersperse pipeline with provided element similar to List.mkString.
Attributes
- Source
- ZPipeline.scala
Intersperse and also add a prefix and a suffix
Transforms the elements of this pipeline using the supplied function.
Transforms the elements of this pipeline using the supplied function.
Attributes
- Source
- ZPipeline.scala
Statefully maps over the elements of this pipeline to produce new elements.
Statefully maps over the elements of this pipeline to produce new elements.
Attributes
- Source
- ZPipeline.scala
Statefully and effectfully maps over the elements of this pipeline to produce new elements.
Statefully and effectfully maps over the elements of this pipeline to produce new elements.
Attributes
- Source
- ZPipeline.scala
Transforms the chunks emitted by this stream.
Creates a pipeline that maps chunks of elements with the specified effect.
Creates a pipeline that maps chunks of elements with the specified effect.
Attributes
- Source
- ZPipeline.scala
Transforms the errors emitted by this pipeline using f.
Attributes
- Source
- ZPipeline.scala
Transforms the errors emitted by this pipeline using f.
Creates a pipeline that maps elements with the specified function that returns a stream.
Creates a pipeline that maps elements with the specified function that returns a stream.
Attributes
- Source
- ZPipeline.scala
Creates a pipeline that maps elements with the specified effectful function.
Creates a pipeline that maps elements with the specified effectful function.
Attributes
- Source
- ZPipeline.scala
Creates a pipeline that maps over elements of the stream with the specified effectful function.
Creates a pipeline that maps over elements of the stream with the specified effectful function.
Unlike mapZIO processing is done chunk by chunk. This means that mapZIOChunked provides weaker guarantees than mapZIO. While stream.mapZIO(f).mapZIO(g) is guaranteed to be equivalent to stream.mapZIO(x => f(x).flatMap(g)), the same is not true for mapZIOChunked. For example, mapZIO guarantees that the first element of a stream will first be processed with f and then g before the second element is processed with f. mapZIOChunked may process the first two elements with f and only then move on to process the first element with g.
Attributes
- Source
- ZPipeline.scala
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. Transformed elements will be emitted in the original order.
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. Transformed elements will be emitted in the original order.
Attributes
- Note
-
This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.
- Source
- ZPipeline.scala
Attributes
- Source
- ZPipeline.scala
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. The element order is not enforced by this combinator, and elements may be reordered.
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. The element order is not enforced by this combinator, and elements may be reordered.
Attributes
- Source
- ZPipeline.scala
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. The element order is not enforced by this combinator, and elements may be reordered.
Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. The element order is not enforced by this combinator, and elements may be reordered.
Attributes
- Source
- ZPipeline.scala
Translates pipeline failure into death of the fiber, making all failures unchecked and not a part of the type of the effect.
Translates pipeline failure into death of the fiber, making all failures unchecked and not a part of the type of the effect.
Attributes
- Source
- ZPipeline.scala
Keeps none of the errors, and terminates the fiber with them, using the specified function to convert the E into a Throwable.
Keeps none of the errors, and terminates the fiber with them, using the specified function to convert the E into a Throwable.
Attributes
- Source
- ZPipeline.scala
Takes the specified number of elements from this pipeline.
Takes all elements of the pipeline until the specified predicate evaluates to true.
Takes all elements of the pipeline until the specified predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Takes all elements of the pipeline until the specified effectual predicate evaluates to true.
Takes all elements of the pipeline until the specified effectual predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Takes all elements of the pipeline for as long as the specified predicate evaluates to true.
Takes all elements of the pipeline for as long as the specified predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Takes all elements of the pipeline for as long as the specified effectual predicate evaluates to true.
Takes all elements of the pipeline for as long as the specified effectual predicate evaluates to true.
Attributes
- Source
- ZPipeline.scala
Adds an effect to consumption of every element of the pipeline.
Throttles the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn function.
Throttles the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn function.
Attributes
- Source
- ZPipeline.scala
Throttles the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn effectful function.
Throttles the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn effectful function.
Attributes
- Source
- ZPipeline.scala
Delays the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each chunk is determined by the costFn function.
Delays the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each chunk is determined by the costFn function.
Attributes
- Source
- ZPipeline.scala
Delays the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each chunk is determined by the costFn effectful function.
Delays the chunks of this pipeline according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each chunk is determined by the costFn effectful function.
Attributes
- Source
- ZPipeline.scala
Converts this pipeline to its underlying channel
Zips this pipeline together with the index of elements.
Attributes
- Source
- ZPipeline.scala
Attributes
- Source
- ZPipeline.scala
Attributes
- Source
- ZPipeline.scala