Take

final case class Take[+E, +A](exit: Exit[Option[E], Chunk[A]]) extends AnyVal

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.

Companion:
object
trait Product
trait Equals
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def done[R](implicit trace: Trace): ZIO[R, Option[E], Chunk[A]]

Transforms Take[E, A] to ZIO[R, E, B].

Transforms Take[E, A] to ZIO[R, E, B].

def fold[Z](end: => Z, error: Cause[E] => Z, value: Chunk[A] => Z): Z

Folds over the failure cause, success value and end-of-stream marker to yield a value.

Folds over the failure cause, success value and end-of-stream marker to yield a value.

def foldZIO[R, E1, Z](end: => ZIO[R, E1, Z], error: Cause[E] => ZIO[R, E1, Z], value: Chunk[A] => ZIO[R, E1, Z])(implicit trace: Trace): ZIO[R, E1, Z]

Effectful version of Take#fold.

Effectful version of Take#fold.

Folds over the failure cause, success value and end-of-stream marker to yield an effect.

def isDone: Boolean

Checks if this take is done (Take.end).

Checks if this take is done (Take.end).

def isFailure: Boolean

Checks if this take is a failure.

Checks if this take is a failure.

def isSuccess: Boolean

Checks if this take is a success.

Checks if this take is a success.

def map[B](f: A => B): Take[E, B]

Transforms Take[E, A] to Take[E, B] by applying function f.

Transforms Take[E, A] to Take[E, B] by applying function f.

def tap[R, E1](f: Chunk[A] => ZIO[R, E1, Any])(implicit trace: Trace): ZIO[R, E1, Unit]

Returns an effect that effectfully "peeks" at the success of this take.

Returns an effect that effectfully "peeks" at the success of this take.

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product