Class/Object

zio.stream

ZPipeline

Related Docs: object ZPipeline | package stream

Permalink

final class ZPipeline[-Env, +Err, -In, +Out] extends AnyRef

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.

Self Type
ZPipeline[Env, Err, In, Out]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZPipeline
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <<<[Env1 <: Env, Err1 >: Err, In2](that: ⇒ ZPipeline[Env1, Err1, In2, In])(implicit trace: Trace): ZPipeline[Env1, Err1, In2, Out]

    Permalink

    Composes two pipelines into one pipeline, by first applying the transformation of the specified pipeline, and then applying the transformation of this pipeline.

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def >>>[Env1 <: Env, Err1 >: Err, Leftover, Out2](that: ⇒ ZSink[Env1, Err1, Out, Leftover, Out2])(implicit trace: Trace): ZSink[Env1, Err1, In, Leftover, Out2]

    Permalink

    Compose this transducer with a sink, resulting in a sink that processes elements by piping them through this transducer and piping the results into the sink.

  6. def >>>[Env1 <: Env, Err1 >: Err, Out2](that: ⇒ ZPipeline[Env1, Err1, Out, Out2])(implicit trace: Trace): ZPipeline[Env1, Err1, In, Out2]

    Permalink

    Composes two pipelines into one pipeline, by first applying the transformation of this pipeline, and then applying the transformation of the specified pipeline.

  7. def andThen[Env1 <: Env, Err1 >: Err, Out2](that: ⇒ ZPipeline[Env1, Err1, Out, Out2])(implicit trace: Trace): ZPipeline[Env1, Err1, In, Out2]

    Permalink

    A named version of the >>> operator.

  8. def apply[Env1 <: Env, Err1 >: Err](stream: ⇒ ZStream[Env1, Err1, In])(implicit trace: Trace): ZStream[Env1, Err1, Out]

    Permalink

    Attach this pipeline to the given stream

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. val channel: ZChannel[Env, ZNothing, Chunk[In], Any, Err, Chunk[Out], Any]

    Permalink
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compose[Env1 <: Env, Err1 >: Err, In2](that: ⇒ ZPipeline[Env1, Err1, In2, In])(implicit trace: Trace): ZPipeline[Env1, Err1, In2, Out]

    Permalink

    A named version of the <<< operator.

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def mapError[Err2](f: (Err) ⇒ Err2)(implicit trace: Trace): ZPipeline[Env, Err2, In, Out]

    Permalink

    Transforms the errors emitted by this pipeline using f.

  20. def mapErrorCause[Err2](f: (Cause[Err]) ⇒ Cause[Err2])(implicit trace: Trace): ZPipeline[Env, Err2, In, Out]

    Permalink

    A more powerful version of mapError which also surfaces the Cause of the channel failure

  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def orDie(implicit ev: <:<[Err, Throwable], trace: Trace): ZPipeline[Env, Nothing, In, Out]

    Permalink

    Translates pipeline failure into death of the fiber, making all failures unchecked and not a part of the type of the effect.

  25. def orDieWith(f: (Err) ⇒ Throwable)(implicit trace: Trace): ZPipeline[Env, Nothing, In, Out]

    Permalink

    Keeps none of the errors, and terminates the fiber with them, using the specified function to convert the E into a Throwable.

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toChannel: ZChannel[Env, ZNothing, Chunk[In], Any, Err, Chunk[Out], Any]

    Permalink

    Converts this pipeline to its underlying channel

  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped