Class/Object

zio.stream

ZStreamChunk

Related Docs: object ZStreamChunk | package stream

Permalink

class ZStreamChunk[-R, +E, +A] extends AnyRef

A ZStreamChunk[R, E, A] represents an effectful stream that can produce values of type A, or potentially fail with a value of type E.

ZStreamChunk differs from ZStream in that elements in the stream are processed in batches, which is orders of magnitude more efficient than dealing with each element individually.

ZStreamChunk is particularly suited for situations where you are dealing with values of primitive types, e.g. those coming off a java.io.InputStream

Self Type
ZStreamChunk[R, E, A]
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZStreamChunk
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ZStreamChunk(chunks: ZStream[R, E, Chunk[A]])

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ++[R1 <: R, E1 >: E, A1 >: A](that: ZStreamChunk[R1, E1, A1]): ZStreamChunk[R1, E1, A1]

    Permalink

    Concatenates with another stream in strict order

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

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. final def buffer(capacity: Int): ZStreamChunk[R, E, A]

    Permalink

    Allows a faster producer to progress independently of a slower consumer by buffering up to capacity chunks in a queue.

    Allows a faster producer to progress independently of a slower consumer by buffering up to capacity chunks in a queue.

    Note

    Prefer capacities that are powers of 2 for better performance.

  7. val chunks: ZStream[R, E, Chunk[A]]

    Permalink
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def collect[B](p: PartialFunction[A, B]): ZStreamChunk[R, E, B]

    Permalink

    Collects a filtered, mapped subset of the stream.

  10. def drop(n: Int): ZStreamChunk[R, E, A]

    Permalink

    Drops the specified number of elements from this stream.

  11. def dropWhile(pred: (A) ⇒ Boolean): ZStreamChunk[R, E, A]

    Permalink

    Drops all elements of the stream for as long as the specified predicate evaluates to true.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def filter(pred: (A) ⇒ Boolean): ZStreamChunk[R, E, A]

    Permalink

    Filters this stream by the specified predicate, retaining all elements for which the predicate evaluates to true.

  15. final def filterNot(pred: (A) ⇒ Boolean): ZStreamChunk[R, E, A]

    Permalink

    Filters this stream by the specified predicate, removing all elements for which the predicate evaluates to true.

  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def flatMap[R1 <: R, E1 >: E, B](f0: (A) ⇒ ZStreamChunk[R1, E1, B]): ZStreamChunk[R1, E1, B]

    Permalink

    Returns a stream made of the concatenation in strict order of all the streams produced by passing each element of this stream to f0

  18. final def flattenChunks: ZStream[R, E, A]

    Permalink

    Returns a stream made of the concatenation of all the chunks in this stream

  19. final def fold[R1 <: R, E1 >: E, A1 >: A, S](s: S)(cont: (S) ⇒ Boolean)(f: (S, A1) ⇒ ZIO[R1, E1, S]): ZIO[R1, E1, S]

    Permalink
  20. final def foldChunks[R1 <: R, E1 >: E, A1 >: A, S](s: S)(cont: (S) ⇒ Boolean)(f: (S, Chunk[A1]) ⇒ ZIO[R1, E1, S]): ZIO[R1, E1, S]

    Permalink
  21. final def foldChunksManaged[R1 <: R, E1 >: E, A1 >: A, S](s: S)(cont: (S) ⇒ Boolean)(f: (S, Chunk[A1]) ⇒ ZIO[R1, E1, S]): ZManaged[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of chunks.

  22. def foldLeft[S](s: S)(f: (S, A) ⇒ S): ZIO[R, E, S]

    Permalink

    Reduces the elements in the stream to a value of type S

  23. final def foldManaged[R1 <: R, E1 >: E, A1 >: A, S](s: S)(cont: (S) ⇒ Boolean)(f: (S, A1) ⇒ ZIO[R1, E1, S]): ZManaged[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

  24. final def foreach[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Unit]): ZIO[R1, E1, Unit]

    Permalink

    Consumes all elements of the stream, passing them to the specified callback.

  25. final def foreachWhile[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean]): ZIO[R1, E1, Unit]

    Permalink

    Consumes elements of the stream, passing them to the specified callback, and terminating consumption when the callback returns false.

  26. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  29. def map[B](f: (A) ⇒ B): ZStreamChunk[R, E, B]

    Permalink

    Returns a stream made of the elements of this stream transformed with f0

  30. final def mapAccum[S1, B](s1: S1)(f1: (S1, A) ⇒ (S1, B)): ZStreamChunk[R, E, B]

    Permalink

    Statefully maps over the elements of this stream to produce new elements.

  31. def mapConcat[B](f: (A) ⇒ Iterable[B]): ZStreamChunk[R, E, B]

    Permalink

    Maps each element to an iterable and flattens the iterable into the output of this stream.

  32. def mapConcatChunk[B](f: (A) ⇒ Chunk[B]): ZStreamChunk[R, E, B]

    Permalink

    Maps each element to a chunk and flattens the chunks into the output of this stream.

  33. final def mapM[R1 <: R, E1 >: E, B](f0: (A) ⇒ ZIO[R1, E1, B]): ZStreamChunk[R1, E1, B]

    Permalink

    Maps over elements of the stream with the specified effectful function.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  37. final def process: ZManaged[R, E, Pull[R, E, A]]

    Permalink
  38. final def run[R1 <: R, E1 >: E, A0, A1 >: A, B](sink: ZSink[R1, E1, A0, Chunk[A1], B]): ZIO[R1, E1, B]

    Permalink

    Runs the sink on the stream to produce either the sink's result or an error.

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

    Permalink
    Definition Classes
    AnyRef
  40. def take(n: Int): ZStreamChunk[R, E, A]

    Permalink

    Takes the specified number of elements from this stream.

  41. def takeWhile(pred: (A) ⇒ Boolean): ZStreamChunk[R, E, A]

    Permalink

    Takes all elements of the stream for as long as the specified predicate evaluates to true.

  42. final def tap[R1 <: R, E1 >: E](f0: (A) ⇒ ZIO[R1, E1, _]): ZStreamChunk[R1, E1, A]

    Permalink

    Adds an effect to consumption of every element of the stream.

  43. final def toQueue[E1 >: E, A1 >: A](capacity: Int = 2): ZManaged[R, E1, Queue[Take[E1, Chunk[A1]]]]

    Permalink

    Converts the stream to a managed queue.

    Converts the stream to a managed queue. After managed queue is used, the queue will never again produce chunks and should be discarded.

  44. final def toQueueWith[R1 <: R, E1 >: E, A1 >: A, Z](f: (Queue[Take[E1, Chunk[A1]]]) ⇒ ZIO[R1, E1, Z], capacity: Int = 1): ZIO[R1, E1, Z]

    Permalink

    Converts the stream to a managed queue and immediately consume its elements.

  45. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def zipWithIndex: ZStreamChunk[R, E, (A, Int)]

    Permalink

    Zips this stream together with the index of elements of the stream across chunks.

Inherited from AnyRef

Inherited from Any

Ungrouped