Pipeline

zio.blocks.streams.Pipeline
See thePipeline companion class
object Pipeline

Companion object for Pipeline. Provides factory constructors for common transformations: map, filter, take, drop, collect, and identity.

Attributes

Companion
class
Source
Pipeline.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Pipeline.type

Members list

Value members

Concrete methods

def buffer[A](n: Int): Pipeline[A, A]

Inserts a bounded buffer of n elements between upstream production and downstream consumption. This is a materialization/asynchronous boundary: it preserves elements and order while decoupling producer and consumer. Closing or cancelling downstream closes the buffer and upstream.

Inserts a bounded buffer of n elements between upstream production and downstream consumption. This is a materialization/asynchronous boundary: it preserves elements and order while decoupling producer and consumer. Closing or cancelling downstream closes the buffer and upstream.

Attributes

Throws
Source
Pipeline.scala
def chunked[A](n: Int): Pipeline[A, Chunk[A]]

Groups consecutive elements into non-empty Chunks of at most n elements. Full chunks have size n; on normal exhaustion the final chunk may be smaller. Grouping spans upstream read boundaries, preserves order, and uses fresh accumulation state for each materialization.

Groups consecutive elements into non-empty Chunks of at most n elements. Full chunks have size n; on normal exhaustion the final chunk may be smaller. Grouping spans upstream read boundaries, preserves order, and uses fresh accumulation state for each materialization.

Attributes

Throws
Source
Pipeline.scala
def collect[A, B](pf: PartialFunction[A, B])(implicit jtB: Infer[B]): Pipeline[A, B]

Applies pf once per input via applyOrElse, emitting only defined results while preserving order. Exceptions thrown while testing or applying pf are defects, not typed stream errors. Runtime type evidence selects specialized primitive reader paths.

Applies pf once per input via applyOrElse, emitting only defined results while preserving order. Exceptions thrown while testing or applying pf are defects, not typed stream errors. Runtime type evidence selects specialized primitive reader paths.

Attributes

Source
Pipeline.scala
def collectAsync[A, B](f: A => encoding.Async[Option[B]])(implicit jtB: Infer[B]): Pipeline[A, B]

Asynchronously evaluates each element, sequentially and in input order, emitting the value of Some and dropping None. A failed or defective Async becomes a stream defect, and cancellation of a suspended callback is propagated. Runtime type evidence selects specialized reader paths.

Asynchronously evaluates each element, sequentially and in input order, emitting the value of Some and dropping None. A failed or defective Async becomes a stream defect, and cancellation of a suspended callback is propagated. Runtime type evidence selects specialized reader paths.

Attributes

Source
Pipeline.scala
def drop[A](n: Long): Pipeline[A, A]

Skips the first n elements of each run, then emits the rest unchanged. Non-positive values skip nothing. Counting state is fresh for every stream or sink materialization.

Skips the first n elements of each run, then emits the rest unchanged. Non-positive values skip nothing. Counting state is fresh for every stream or sink materialization.

Attributes

Source
Pipeline.scala
def filter[A](pred: A => Boolean): Pipeline[A, A]

Emits elements satisfying pred, in input order. The predicate is evaluated once per element; thrown exceptions are defects rather than typed stream errors. Runtime type evidence preserves primitive specialization.

Emits elements satisfying pred, in input order. The predicate is evaluated once per element; thrown exceptions are defects rather than typed stream errors. Runtime type evidence preserves primitive specialization.

Attributes

Source
Pipeline.scala
def filterAsync[A](f: A => encoding.Async[Boolean]): Pipeline[A, A]

Asynchronously tests each element, sequentially and in input order, emitting it only when f yields true. A failed or defective Async becomes a stream defect, and cancellation of a suspended predicate is propagated. Runtime type evidence preserves primitive specialization.

Asynchronously tests each element, sequentially and in input order, emitting it only when f yields true. A failed or defective Async becomes a stream defect, and cancellation of a suspended predicate is propagated. Runtime type evidence preserves primitive specialization.

Attributes

Source
Pipeline.scala
def identity[A]: Pipeline[A, A]

Passes every element through unchanged, preserving order, errors, and resource behavior. It is the identity for Pipeline.andThen and returns its input stream or sink unchanged, preserving any specialized reader path.

Passes every element through unchanged, preserving order, errors, and resource behavior. It is the identity for Pipeline.andThen and returns its input stream or sink unchanged, preserving any specialized reader path.

Attributes

Source
Pipeline.scala
def map[A](f: A => Nothing)(implicit dummy: DummyImplicit): Pipeline[A, Nothing]

Maps each element lazily with a function whose result is Nothing. This overload preserves bottom-type inference and uses a boxed output lane. Thrown exceptions are defects rather than typed stream errors.

Maps each element lazily with a function whose result is Nothing. This overload preserves bottom-type inference and uses a boxed output lane. Thrown exceptions are defects rather than typed stream errors.

Attributes

Source
Pipeline.scala
def map[A, B](f: A => B)(implicit jtB: Infer[B]): Pipeline[A, B]

Lazily transforms each element with f, preserving input order and cardinality. Thrown exceptions are defects rather than typed stream errors. Runtime type evidence selects specialized primitive input and output reader paths.

Lazily transforms each element with f, preserving input order and cardinality. Thrown exceptions are defects rather than typed stream errors. Runtime type evidence selects specialized primitive input and output reader paths.

Attributes

Source
Pipeline.scala
def mapAsync[A, B](f: A => encoding.Async[B])(implicit jtB: Infer[B]): Pipeline[A, B]

Asynchronously transforms each element, sequentially and in input order. Each callback is awaited before the next element is processed. A failed or defective Async fails the stream as a defect rather than through its typed error channel; cancellation of a suspended callback is propagated. Runtime type evidence selects specialized primitive reader paths.

Asynchronously transforms each element, sequentially and in input order. Each callback is awaited before the next element is processed. A failed or defective Async fails the stream as a defect rather than through its typed error channel; cancellation of a suspended callback is propagated. Runtime type evidence selects specialized primitive reader paths.

Attributes

Source
Pipeline.scala
def take[A](n: Long): Pipeline[A, A]

Emits at most the first n elements of each run and then closes upstream early. Non-positive values produce an empty stream. Counting state is fresh for every stream or sink materialization.

Emits at most the first n elements of each run and then closes upstream early. Non-positive values produce an empty stream. Counting state is fresh for every stream or sink materialization.

Attributes

Source
Pipeline.scala