package stream
- Alphabetic
- By Inheritance
- stream
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type Sink[+E, A, +L, +B] = ZSink[Any, E, A, L, B]
- type Stream[+E, +A] = ZStream[Any, E, A]
- trait StreamPlatformSpecificConstructors extends AnyRef
- final class SubscriptionRef[A] extends AnyRef
A
SubscriptionRef[A]contains aRefM[A]and aStreamthat will emit every change to theRefM. - final case class Take[+E, +A](exit: Exit[Option[E], Chunk[A]]) extends AnyVal with Product with Serializable
A
Take[E, A]represents a singletakefrom a queue modeling a stream of values.A
Take[E, A]represents a singletakefrom a queue modeling a stream of values. ATakemay be a failure causeCause[E], an chunk valueAor an end-of-stream marker. - type Transducer[+E, -A, +B] = ZTransducer[Any, E, A, B]
- abstract class ZSink[-R, +E, -I, +L, +Z] extends AnyRef
- trait ZSinkPlatformSpecificConstructors extends AnyRef
- abstract class ZStream[-R, +E, +O] extends AnyRef
A
ZStream[R, E, O]is a description of a program that, when evaluated, may emit 0 or more values of typeO, may fail with errors of typeEand uses an environment of typeR.A
ZStream[R, E, O]is a description of a program that, when evaluated, may emit 0 or more values of typeO, may fail with errors of typeEand uses an environment of typeR. One way to think ofZStreamis as aZIOprogram that could emit multiple values.Another analogue to
ZStreamis an imperative iterator:trait Iterator[A] { def next: A }
This data type can emit multiple
Avalues through multiple calls tonext. Similarly, embedded inside everyZStreamis 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 typeNonesignals the end of the stream.ZStreamis 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,ZStreamdoes 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 allowsZStreamto model network and file-based stream processing extremely efficiently.The last important attribute of
ZStreamis resource management: it makes heavy use of ZManaged to manage resources that are acquired and released during the stream's lifetime.ZStreamforms a monad on itsOtype parameter, and has error management facilities for itsEtype parameter, modeled similarly to ZIO (with some adjustments for the multiple-valued nature ofZStream). These aspects allow for rich and expressive composition of streams.The current encoding of
ZStreamis *not* safe for recursion.ZStreamprograms 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 ++ foreverInstead, recursive operators must be defined explicitly. See the definition of ZStream#forever for an example. This limitation will be lifted in the future.
- trait ZStreamPlatformSpecificConstructors extends AnyRef
- abstract class ZTransducer[-R, +E, -I, +O] extends AnyRef
Value Members
- val Sink: ZSink.type
- val Stream: ZStream.type
- val Transducer: ZTransducer.type
- object BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
- object SubscriptionRef
- object Take extends Serializable
- object ZSink extends ZSinkPlatformSpecificConstructors
- object ZStream extends ZStreamPlatformSpecificConstructors
- object ZTransducer