Package

zio

stream

Permalink

package stream

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. stream
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Sink[+E, A, +L, +B] = ZSink[Any, E, A, L, B]

    Permalink
  2. type Stream[+E, +A] = ZStream[Any, E, A]

    Permalink
  3. final class SubscriptionRef[A] extends AnyRef

    Permalink

    A SubscriptionRef[A] contains a RefM with a value of type A and a ZStream that can be subscribed to in order to receive the current value as well as all changes to the value.

  4. final case class Take[+E, +A](exit: Exit[Option[E], Chunk[A]]) extends AnyVal with Product with Serializable

    Permalink

    A Take[E, A] represents a single take from a queue modeling a stream of values.

    A Take[E, A] represents a single take from a queue modeling a stream of values. A Take may be a failure cause Cause[E], an chunk value A or an end-of-stream marker.

  5. type Transducer[+E, -A, +B] = ZTransducer[Any, E, A, B]

    Permalink
  6. type UStream[+A] = ZStream[Any, Nothing, A]

    Permalink
  7. abstract class ZSink[-R, +E, -I, +L, +Z] extends AnyRef

    Permalink
  8. trait ZSinkPlatformSpecificConstructors extends AnyRef

    Permalink
  9. abstract class ZStream[-R, +E, +O] extends AnyRef

    Permalink

    A ZStream[R, E, O] is a description of a program that, when evaluated, may emit 0 or more values of type O, may fail with errors of type E and uses an environment of type R.

    A ZStream[R, E, O] is a description of a program that, when evaluated, may emit 0 or more values of type O, may fail with errors of type E and uses an environment of type R. One way to think of ZStream is as a ZIO program that could emit multiple values.

    Another analogue to ZStream is an imperative iterator:

    trait Iterator[A] {
      def next: A
    }

    This data type can emit multiple A values through multiple calls to next. Similarly, embedded inside every ZStream is a ZIO program: ZIO[R, Option[E], Chunk[O]]. This program will be repeatedly evaluated as part of the stream execution. For every evaluation, it will emit a chunk of values or end with an optional failure. A failure of type None signals the end of the stream.

    ZStream is a purely functional *pull* based stream. Pull based streams offer inherent laziness and backpressure, relieving users of the need to manage buffers between operators. As an optimization, ZStream does not emit single values, but rather zio.Chunk values. This allows the cost of effect evaluation to be amortized and most importantly, keeps primitives unboxed. This allows ZStream to model network and file-based stream processing extremely efficiently.

    The last important attribute of ZStream is resource management: it makes heavy use of ZManaged to manage resources that are acquired and released during the stream's lifetime.

    ZStream forms a monad on its O type parameter, and has error management facilities for its E type parameter, modeled similarly to ZIO (with some adjustments for the multiple-valued nature of ZStream). These aspects allow for rich and expressive composition of streams.

    The current encoding of ZStream is *not* safe for recursion. ZStream programs that are defined in terms of themselves will leak memory. For example, the following implementation of ZStream#forever is not heap-safe:

    def forever = self ++ forever

    Instead, recursive operators must be defined explicitly. See the definition of ZStream#forever for an example. This limitation will be lifted in the future.

  10. trait ZStreamPlatformSpecificConstructors extends AnyRef

    Permalink
  11. abstract class ZTransducer[-R, +E, -I, +O] extends AnyRef

    Permalink
  12. trait ZTransducerPlatformSpecificConstructors extends AnyRef

    Permalink

Value Members

  1. object BuildInfo extends Product with Serializable

    Permalink

    This object was generated by sbt-buildinfo.

  2. val Sink: ZSink.type

    Permalink
  3. val Stream: ZStream.type

    Permalink
  4. object SubscriptionRef

    Permalink
  5. object Take extends Serializable

    Permalink
  6. val Transducer: ZTransducer.type

    Permalink
  7. val UStream: ZStream.type

    Permalink
  8. object ZSink extends ZSinkPlatformSpecificConstructors

    Permalink
  9. object ZStream extends ZStreamPlatformSpecificConstructors

    Permalink
  10. object ZTransducer extends ZTransducerPlatformSpecificConstructors

    Permalink
  11. package compression

    Permalink
  12. package internal

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped