Packages

class ZStream[-R, +E, +A] extends Serializable

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

Streams have a very similar API to Scala collections, making them immediately familiar to most developers. Unlike Scala collections, streams can be used on effectful streams of data, such as HTTP connections, files, and so forth.

Streams do not leak resources. This guarantee holds in the presence of early termination (not all of a stream is consumed), failure, or even interruption.

Thanks to only first-order types, appropriate variance annotations, and specialized effect type (ZIO), streams feature extremely good type inference and should almost never require specification of any type parameters.

process is a low-level consumption method, usually used for creating combinators and constructors. For most usage, ZStream#fold, ZStream#foreach or ZStream#run should be preferred.

The contract for the returned Pull is as follows: - It must not be evaluted concurrently from multiple fibers - it is (usually) not thread-safe; - If an evaluation of the Pull is interrupted, it is not safe to evaluate it again - it is (usually) not interruption-safe; - Once the Pull has failed with a None, it is not safe to evaluate it again.

The managed Pull can be used to read from the stream until it is empty (or possibly forever, if the stream is infinite). The provided Pull is valid only inside the scope of the managed resource.

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

Instance Constructors

  1. new ZStream(process: ZManaged[R, E, Pull[R, E, A]])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ++[R1 <: R, E1 >: E, A1 >: A](other: => ZStream[R1, E1, A1]): ZStream[R1, E1, A1]

    Concatenates with another stream in strict order

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def aggregate[R1 <: R, E1 >: E, A1 >: A, B](sink: ZSink[R1, E1, A1, A1, B]): ZStream[R1, E1, B]

    Aggregates elements of this stream using the provided sink for as long as the downstream operators on the stream are busy.

    Aggregates elements of this stream using the provided sink for as long as the downstream operators on the stream are busy.

    This operator divides the stream into two asynchronous "islands". Operators upstream of this operator run on one fiber, while downstream operators run on another. Whenever the downstream fiber is busy processing elements, the upstream fiber will feed elements into the sink until it signals completion.

    Any sink can be used here, but see Sink.foldWeightedM and Sink.foldUntilM for sinks that cover the common usecases.

  6. final def aggregateWithin[R1 <: R, E1 >: E, A1 >: A, B, C](sink: ZSink[R1, E1, A1, A1, B], schedule: ZSchedule[R1, Option[B], C]): ZStream[R1 with Clock, E1, Either[C, B]]

    Aggregates elements using the provided sink until it signals completion, or the delay signalled by the schedule has passed.

    Aggregates elements using the provided sink until it signals completion, or the delay signalled by the schedule has passed.

    This operator divides the stream into two asynchronous islands. Operators upstream of this operator run on one fiber, while downstream operators run on another. Elements will be aggregated by the sink until the downstream fiber pulls the aggregated value, or until the schedule's delay has passed.

    Aggregated elements will be fed into the schedule to determine the delays between pulls.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. final def broadcast[E1 >: E, A1 >: A](n: Int, maximumLag: Int): ZManaged[R, Nothing, List[ZStream[Any, E, A]]]

    Fan out the stream, producing a list of streams that have the same elements as this stream.

    Fan out the stream, producing a list of streams that have the same elements as this stream. The driver streamer will only ever advance of the maximumLag values before the slowest downstream stream.

  9. final def broadcastedQueues[E1 >: E, A1 >: A](n: Int, maximumLag: Int): ZManaged[R, Nothing, List[Queue[Take[E1, A1]]]]

    Converts the stream to a managed list of queues.

    Converts the stream to a managed list of queues. Every value will be replicated to every queue with the slowest queue being allowed to buffer maximumLag elements before the driver is backpressured. The downstream queues will be provided with elements in the same order they are returned, so the fastest queue might have seen up to (maximumLag + 1) elements more than the slowest queue if it has a lower index than the slowest queue. During the finalizer the driver will wait for all queues to shutdown in order to signal completion. After the managed value is used, the queues will never again produce values and should be discarded.

  10. final def buffer(capacity: Int): ZStream[R, E, A]

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

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

    Note

    when possible, prefer capacities that are powers of 2 for better performance.

  11. final def catchAll[R1 <: R, E2, A1 >: A](f: (E) => ZStream[R1, E2, A1]): ZStream[R1, E2, A1]

    Switches over to the stream produced by the provided function in case this one fails with a typed error.

  12. final def catchAllCause[R1 <: R, E2, A1 >: A](f: (Cause[E]) => ZStream[R1, E2, A1]): ZStream[R1, E2, A1]

    Switches over to the stream produced by the provided function in case this one fails.

    Switches over to the stream produced by the provided function in case this one fails. Allows recovery from all errors, except external interruption.

  13. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. def collect[B](pf: PartialFunction[A, B]): ZStream[R, E, B]

    Performs a filter and map in a single step.

  15. def collectWhile[B](pred: PartialFunction[A, B]): ZStream[R, E, B]

    Transforms all elements of the stream for as long as the specified partial function is defined.

  16. final def combine[R1 <: R, E1 >: E, A1 >: A, S1, B, C](that: ZStream[R1, E1, B])(s1: S1)(f0: (S1, Pull[R, E, A], Pull[R1, E1, B]) => ZIO[R1, E1, (S1, Take[E1, C])]): ZStream[R1, E1, C]

    Combines this stream and the specified stream by repeatedly applying the function f0 to extract an element from the queues and conceptually "offer" it to the destination stream.

    Combines this stream and the specified stream by repeatedly applying the function f0 to extract an element from the queues and conceptually "offer" it to the destination stream. f0 can maintain some internal state to control the combining process, with the initial state being specified by s1.

  17. final def concat[R1 <: R, E1 >: E, A1 >: A](other: => ZStream[R1, E1, A1]): ZStream[R1, E1, A1]

    Appends another stream to this stream.

    Appends another stream to this stream. The concatenated stream will first emit the elements of this stream, and then emit the elements of the other stream.

  18. final def distributedDynamicWith[E1 >: E, A1 >: A](maximumLag: Int, decide: (A) => UIO[(Int) => Boolean], done: (Take[E1, Nothing]) => UIO[_] = (_: Any) => UIO.unit): ZManaged[R, Nothing, UIO[(Int, Queue[Take[E1, A1]])]]

    More powerful version of ZStream#distributedWith.

    More powerful version of ZStream#distributedWith. This returns a function that will produce new queues and corresponding indices. You can also provide a function that will be executed after the final events are enqueued in all queues but before the queues are actually shutdown. Shutdown of the queues is handled by the driver. Downstream users can also shutdown queues manually. In this case the driver will continue but no longer backpressure on them.

  19. final def distributedWith[E1 >: E, A1 >: A](n: Int, maximumLag: Int, decide: (A) => UIO[(Int) => Boolean]): ZManaged[R, Nothing, List[Queue[Take[E1, A1]]]]

    More powerful version of ZStream#broadcast.

    More powerful version of ZStream#broadcast. Allows to provide a function that determines what queues should receive which elements.

  20. final def drain: ZStream[R, E, Nothing]

    Converts this stream to a stream that executes its effects but emits no elements.

    Converts this stream to a stream that executes its effects but emits no elements. Useful for sequencing effects using streams:

    (Stream(1, 2, 3).tap(i => ZIO(println(i))) ++
      Stream.lift(ZIO(println("Done!"))).drain ++
      Stream(4, 5, 6).tap(i => ZIO(println(i)))).run(Sink.drain)
  21. final def drop(n: Int): ZStream[R, E, A]

    Drops the specified number of elements from this stream.

  22. def dropWhile(pred: (A) => Boolean): ZStream[R, E, A]

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

  23. final def ensuring[R1 <: R](fin: ZIO[R1, Nothing, _]): ZStream[R1, E, A]

    Executes the provided finalizer after this stream's finalizers run.

  24. final def ensuringFirst[R1 <: R](fin: ZIO[R1, Nothing, _]): ZStream[R1, E, A]

    Executes the provided finalizer before this stream's finalizers run.

  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  27. def filter(pred: (A) => Boolean): ZStream[R, E, A]

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

  28. final def filterM[R1 <: R, E1 >: E](pred: (A) => ZIO[R1, E1, Boolean]): ZStream[R1, E1, A]

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

  29. final def filterNot(pred: (A) => Boolean): ZStream[R, E, A]

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

  30. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  31. final def fixed[R1 <: R, E1 >: E, A1 >: A](duration: Duration): ZStream[R1 with Clock, E1, A1]

    Emits elements of this stream with a fixed delay in between, regardless of how long it takes to produce a value.

  32. final def flatMap[R1 <: R, E1 >: E, B](f0: (A) => ZStream[R1, E1, B]): ZStream[R1, E1, B]

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

  33. final def flatMapPar[R1 <: R, E1 >: E, B](n: Int, outputBuffer: Int = 16)(f: (A) => ZStream[R1, E1, B]): ZStream[R1, E1, B]

    Maps each element of this stream to another stream and returns the non-deterministic merge of those streams, executing up to n inner streams concurrently.

    Maps each element of this stream to another stream and returns the non-deterministic merge of those streams, executing up to n inner streams concurrently. Up to outputBuffer elements of the produced streams may be buffered in memory by this operator.

  34. final def flatMapParSwitch[R1 <: R, E1 >: E, B](n: Int, bufferSize: Int = 16)(f: (A) => ZStream[R1, E1, B]): ZStream[R1, E1, B]

    Maps each element of this stream to another stream and returns the non-deterministic merge of those streams, executing up to n inner streams concurrently.

    Maps each element of this stream to another stream and returns the non-deterministic merge of those streams, executing up to n inner streams concurrently. When a new stream is created from an element of the source stream, the oldest executing stream is cancelled. Up to bufferSize elements of the produced streams may be buffered in memory by this operator.

  35. 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]

    Executes an effectful fold over the stream of values.

  36. final def foldLeft[A1 >: A, S](s: S)(f: (S, A1) => S): ZIO[R, E, S]

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

  37. 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]

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values. Returns a Managed value that represents the scope of the stream.

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

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

  39. final def foreachManaged[R1 <: R, E1 >: E](f: (A) => ZIO[R1, E1, _]): ZManaged[R1, E1, Unit]

    Like ZStream#foreach, but returns a ZManaged so the finalization order can be controlled.

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

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

  41. final def foreachWhileManaged[R1 <: R, E1 >: E](f: (A) => ZIO[R1, E1, Boolean]): ZManaged[R1, E1, Unit]

    Like ZStream#foreachWhile, but returns a ZManaged so the finalization order can be controlled.

  42. final def forever: ZStream[R, E, A]

    Repeats this stream forever.

  43. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  44. def groupBy[R1 <: R, E1 >: E, K, V, A1](f: (A) => ZIO[R1, E1, (K, V)], buffer: Int = 16): GroupBy[R1, E1, K, V]

    More powerful version of ZStream#groupByKey

  45. def groupByKey[R1 <: R, E1 >: E, K](f: (A) => K, buffer: Int = 16): GroupBy[R1, E1, K, A]

    Group a stream using a function.

  46. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  47. final def interleave[R1 <: R, E1 >: E, A1 >: A](that: ZStream[R1, E1, A1]): ZStream[R1, E1, A1]

    Interleaves this stream and the specified stream deterministically by alternating pulling values from this stream and the specified stream.

    Interleaves this stream and the specified stream deterministically by alternating pulling values from this stream and the specified stream. When one stream is exhausted all remaining values in the other stream will be pulled.

  48. final def interleaveWith[R1 <: R, E1 >: E, A1 >: A](that: ZStream[R1, E1, A1])(b: ZStream[R1, E1, Boolean]): ZStream[R1, E1, A1]

    Combines this stream and the specified stream deterministically using the stream of boolean values b to control which stream to pull from next.

    Combines this stream and the specified stream deterministically using the stream of boolean values b to control which stream to pull from next. true indicates to pull from this stream and false indicates to pull from the specified stream. Only consumes as many elements as requested by b. If either this stream or the specified stream are exhausted further requests for values from that stream will be ignored.

  49. final def into[R1 <: R, E1 >: E, A1 >: A](queue: ZQueue[R1, E1, _, _, Take[E1, A1], _]): ZIO[R1, E1, Unit]

    Enqueues elements of this stream into a queue.

    Enqueues elements of this stream into a queue. Stream failure and ending will also be signalled.

  50. final def intoManaged[R1 <: R, E1 >: E, A1 >: A](queue: ZQueue[R1, E1, _, _, Take[E1, A1], _]): ZManaged[R1, E1, Unit]

    Like ZStream#into, but provides the result as a ZManaged to allow for scope composition.

  51. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  52. def map[B](f0: (A) => B): ZStream[R, E, B]

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

  53. def mapAccum[S1, B](s1: S1)(f1: (S1, A) => (S1, B)): ZStream[R, E, B]

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

  54. final def mapAccumM[R1 <: R, E1 >: E, S1, B](s1: S1)(f1: (S1, A) => ZIO[R1, E1, (S1, B)]): ZStream[R1, E1, B]

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

  55. def mapConcat[B](f: (A) => Chunk[B]): ZStream[R, E, B]

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

  56. final def mapConcatM[R1 <: R, E1 >: E, B](f: (A) => ZIO[R1, E1, Chunk[B]]): ZStream[R1, E1, B]

    Effectfully maps each element to a chunk, and flattens the chunks into the output of this stream.

  57. final def mapError[E1](f: (E) => E1): ZStream[R, E1, A]

    Transforms the errors that possibly result from this stream.

  58. final def mapErrorCause[E1](f: (Cause[E]) => Cause[E1]): ZStream[R, E1, A]

    Transforms the errors that possibly result from this stream.

  59. final def mapM[R1 <: R, E1 >: E, B](f: (A) => ZIO[R1, E1, B]): ZStream[R1, E1, B]

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

  60. final def mapMPar[R1 <: R, E1 >: E, B](n: Int)(f: (A) => ZIO[R1, E1, B]): ZStream[R1, E1, B]

    Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently.

    Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. Transformed elements will be emitted in the original order.

  61. final def mapMParUnordered[R1 <: R, E1 >: E, B](n: Int)(f: (A) => ZIO[R1, E1, B]): ZStream[R1, E1, B]

    Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently.

    Maps over elements of the stream with the specified effectful function, executing up to n invocations of f concurrently. The element order is not enforced by this combinator, and elements may be reordered.

  62. final def merge[R1 <: R, E1 >: E, A1 >: A](that: ZStream[R1, E1, A1]): ZStream[R1, E1, A1]

    Merges this stream and the specified stream together.

  63. final def mergeEither[R1 <: R, E1 >: E, B](that: ZStream[R1, E1, B]): ZStream[R1, E1, Either[A, B]]

    Merges this stream and the specified stream together to produce a stream of eithers.

  64. final def mergeWith[R1 <: R, E1 >: E, B, C](that: ZStream[R1, E1, B])(l: (A) => C, r: (B) => C): ZStream[R1, E1, C]

    Merges this stream and the specified stream together to a common element type with the specified mapping functions.

  65. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  66. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  67. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  68. final def orElse[R1 <: R, E2, A1 >: A](that: => ZStream[R1, E2, A1]): ZStream[R1, E2, A1]

    Switches to the provided stream in case this one fails with a typed error.

    Switches to the provided stream in case this one fails with a typed error.

    See also ZStream#catchAll.

  69. def partition(p: (A) => Boolean, buffer: Int = 16): ZManaged[R, E, (ZStream[R, E, A], ZStream[Any, E, A])]

    Partition a stream using a predicate.

    Partition a stream using a predicate. The first stream will contain all element evaluated to true and the second one will contain all element evaluated to false. The faster stream may advance by up to buffer elements further than the slower one.

  70. def partitionEither[B, C, R1 <: R, E1 >: E](p: (A) => ZIO[R1, E1, Either[B, C]], buffer: Int = 16): ZManaged[R1, E1, (ZStream[Any, E1, B], ZStream[Any, E1, C])]

    Split a stream by a predicate.

    Split a stream by a predicate. The faster stream may advance by up to buffer elements further than the slower one.

  71. final def peel[R1 <: R, E1 >: E, A1 >: A, B](sink: ZSink[R1, E1, A1, A1, B]): ZManaged[R1, E1, (B, ZStream[R1, E1, A1])]

    Peels off enough material from the stream to construct an R using the provided ZSink and then returns both the R and the remainder of the ZStream in a managed resource.

    Peels off enough material from the stream to construct an R using the provided ZSink and then returns both the R and the remainder of the ZStream in a managed resource. Like all ZManaged values, the provided remainder is valid only within the scope of ZManaged.

  72. val process: ZManaged[R, E, Pull[R, E, A]]
  73. final def provide(r: R): Stream[E, A]

    Provides the stream with its required environment, which eliminates its dependency on R.

  74. final def provideM[E1 >: E](r: ZIO[Any, E1, R]): Stream[E1, A]

    An effectual version of provide, useful when the act of provision requires an effect.

  75. final def provideManaged[E1 >: E](m: Managed[E1, R]): Stream[E1, A]

    Uses the given Managed to provide the environment required to run this stream, leaving no outstanding environments.

  76. final def provideSome[R0](env: (R0) => R): ZStream[R0, E, A]

    Provides some of the environment required to run this effect, leaving the remainder R0.

  77. final def provideSomeM[R0, E1 >: E](env: ZIO[R0, E1, R]): ZStream[R0, E1, A]

    Provides some of the environment required to run this effect, leaving the remainder R0.

  78. final def provideSomeManaged[R0, E1 >: E](env: ZManaged[R0, E1, R]): ZStream[R0, E1, A]

    Uses the given ZManaged to provide some of the environment required to run this stream, leaving the remainder R0.

  79. final def repeat[R1 <: R](schedule: ZSchedule[R1, Unit, Any]): ZStream[R1 with Clock, E, A]

    Repeats the entire stream using the specified schedule.

    Repeats the entire stream using the specified schedule. The stream will execute normally, and then repeat again according to the provided schedule.

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

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

  81. final def runCollect: ZIO[R, E, List[A]]

    Runs the stream and collects all of its elements in a list.

    Runs the stream and collects all of its elements in a list.

    Equivalent to run(Sink.collectAll[A]).

  82. final def runDrain: ZIO[R, E, Unit]

    Runs the stream purely for its effects.

    Runs the stream purely for its effects. Any elements emitted by the stream are discarded.

    Equivalent to run(Sink.drain).

  83. final def schedule[R1 <: R, A1 >: A](schedule: ZSchedule[R1, A, A1]): ZStream[R1 with Clock, E, A1]

    Schedules the output of the stream using the provided schedule and emits its output at the end (if schedule is finite).

  84. final def scheduleEither[R1 <: R, E1 >: E, B](schedule: ZSchedule[R1, A, B]): ZStream[R1 with Clock, E1, Either[B, A]]

    Schedules the output of the stream using the provided schedule and emits its output at the end (if schedule is finite).

  85. final def scheduleElements[R1 <: R, A1 >: A](schedule: ZSchedule[R1, A, A1]): ZStream[R1 with Clock, E, A1]

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed.

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed. Repeats are done in addition to the first execution, so that scheduleElements(Schedule.once) means "emit element and if not short circuited, repeat element once".

  86. final def scheduleElementsEither[R1 <: R, E1 >: E, B](schedule: ZSchedule[R1, A, B]): ZStream[R1 with Clock, E1, Either[B, A]]

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed.

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed. Repeats are done in addition to the first execution, so that scheduleElements(Schedule.once) means "emit element and if not short circuited, repeat element once".

  87. final def scheduleElementsWith[R1 <: R, E1 >: E, B, C](schedule: ZSchedule[R1, A, B])(f: (A) => C, g: (B) => C): ZStream[R1 with Clock, E1, C]

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed.

    Repeats each element of the stream using the provided schedule, additionally emitting the schedule's output each time a schedule is completed. Repeats are done in addition to the first execution, so that scheduleElements(Schedule.once) means "emit element and if not short circuited, repeat element once". Uses the provided functions to align the stream and schedule outputs on a common type.

  88. final def scheduleWith[R1 <: R, E1 >: E, B, C](schedule: ZSchedule[R1, A, B])(f: (A) => C, g: (B) => C): ZStream[R1 with Clock, E1, C]

    Schedules the output of the stream using the provided schedule and emits its output at the end (if schedule is finite).

    Schedules the output of the stream using the provided schedule and emits its output at the end (if schedule is finite). Uses the provided function to align the stream and schedule outputs on the same type.

  89. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  90. def take(n: Int): ZStream[R, E, A]

    Takes the specified number of elements from this stream.

  91. def takeWhile(pred: (A) => Boolean): ZStream[R, E, A]

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

  92. final def tap[R1 <: R, E1 >: E](f: (A) => ZIO[R1, E1, _]): ZStream[R1, E1, A]

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

  93. final def throttleEnforce(units: Long, duration: Duration, burst: Long = 0)(costFn: (A) => Long): ZStream[R with Clock, E, A]

    Throttles elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Throttles elements of type A according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Elements that do not meet the bandwidth constraints are dropped. The weight of each element is determined by the costFn function.

  94. final def throttleEnforceM[R1 <: R, E1 >: E](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) => ZIO[R1, E1, Long]): ZStream[R1 with Clock, E1, A]

    Throttles elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Throttles elements of type A according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Elements that do not meet the bandwidth constraints are dropped. The weight of each element is determined by the costFn effectful function.

  95. final def throttleShape(units: Long, duration: Duration, burst: Long = 0)(costFn: (A) => Long): ZStream[R with Clock, E, A]

    Delays elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Delays elements of type A according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each element is determined by the costFn function.

  96. final def throttleShapeM[R1 <: R, E1 >: E](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) => ZIO[R1, E1, Long]): ZStream[R1 with Clock, E1, A]

    Delays elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Delays elements of type A according to the given bandwidth parameters using the token bucket algorithm. Allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each element is determined by the costFn effectful function.

  97. final def timeout(d: Duration): ZStream[R with Clock, E, A]

    Interrupts the stream if it does not produce a value after d duration.

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

    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 values and should be discarded.

  99. def toString(): String
    Definition Classes
    AnyRef → Any
  100. def transduce[R1 <: R, E1 >: E, A1 >: A, C](sink: ZSink[R1, E1, A1, A1, C]): ZStream[R1, E1, C]

    Applies a transducer to the stream, which converts one or more elements of type A into elements of type C.

  101. final def transduceManaged[R1 <: R, E1 >: E, A1 >: A, B](managedSink: ZManaged[R1, E1, ZSink[R1, E1, A1, A1, B]]): ZStream[R1, E1, B]

    Applies a transducer to the stream, converting elements of type A into elements of type C, with a managed resource of type D available.

  102. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  103. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  104. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  105. final def zip[R1 <: R, E1 >: E, B](that: ZStream[R1, E1, B]): ZStream[R1, E1, (A, B)]

    Zips this stream together with the specified stream.

  106. final def zipWith[R1 <: R, E1 >: E, B, C](that: ZStream[R1, E1, B])(f0: (Option[A], Option[B]) => Option[C]): ZStream[R1, E1, C]

    Zips two streams together with a specified function.

  107. final def zipWithIndex: ZStream[R, E, (A, Int)]

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

  108. final def zipWithLatest[R1 <: R, E1 >: E, B, C](that: ZStream[R1, E1, B])(f0: (A, B) => C): ZStream[R1, E1, C]

    Zips the two streams so that when a value is emitted by either of the two streams, it is combined with the latest value from the other stream to produce a result.

Deprecated Value Members

  1. final def spaced[R1 <: R, A1 >: A](schedule: ZSchedule[R1, A, A1]): ZStream[R1 with Clock, E, A1]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use scheduleElements

  2. final def spacedEither[R1 <: R, B](schedule: ZSchedule[R1, A, B]): ZStream[R1 with Clock, E, Either[B, A]]

    Analogical to spaced but with distinction of stream elements and schedule output represented by Either

    Analogical to spaced but with distinction of stream elements and schedule output represented by Either

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use scheduleElementsEither

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped