Class/Object

zio.stream

ZStream

Related Docs: object ZStream | package stream

Permalink

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

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

Instance Constructors

  1. new ZStream(channel: ZChannel[R, Any, Any, Any, E, Chunk[A], Any])

    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, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Symbolic alias for ZStream#zipRight.

  4. final def *>[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Symbolic alias for ZStream#crossRight.

  5. def ++[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Symbolic alias for ZStream#concat.

  6. final def <&[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Symbolic alias for ZStream#zipLeft.

  7. final def <&>[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit zippable: Zippable[A, A2], trace: ZTraceElement): ZStream[R1, E1, Out]

    Permalink

    Symbolic alias for ZStream#zip.

  8. final def <*[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Symbolic alias for ZStream#crossLeft.

  9. final def <*>[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit zippable: Zippable[A, A2], trace: ZTraceElement): ZStream[R1, E1, Out]

    Permalink

    Symbolic alias for ZStream#cross.

  10. final def <>[R1 <: R, E2, A1 >: A](that: ⇒ ZStream[R1, E2, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R1, E2, A1]

    Permalink

    Symbolic alias for ZStream#orElse.

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def >>>[R1 <: R, E1 >: E, A2 >: A, Z](sink: ⇒ ZSink[R1, E1, A2, Any, Z])(implicit trace: ZTraceElement): ZIO[R1, E1, Z]

    Permalink

    Symbolic alias for zio.stream.ZStream!.run[R1<:R,E1>:E,B]*.

  13. def >>>[R1 <: R, E1 >: E, B](pipeline: ZPipeline[R1, E1, A, B])(implicit trace: ZTraceElement): ZStream[R1, E1, B]

    Permalink

    Symbolic alias for ZStream#via.

  14. final def absolve[R1 <: R, E1, A1](implicit ev: <:<[ZStream[R, E, A], ZStream[R1, E1, Either[E1, A1]]], trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Returns a stream that submerges the error case of an Either into the ZStream.

  15. final def aggregateAsync[R1 <: R, E1 >: E, A1 >: A, B](sink: ⇒ ZSink[R1, E1, A1, A1, B])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, B]

    Permalink

    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 ZSink.foldWeightedM and ZSink.foldUntilM for sinks that cover the common usecases.

  16. final def aggregateAsyncWithin[R1 <: R, E1 >: E, A1 >: A, B](sink: ⇒ ZSink[R1, E1, A1, A1, B], schedule: ⇒ Schedule[R1, Option[B], Any])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, B]

    Permalink

    Like aggregateAsyncWithinEither, but only returns the Right results.

    Like aggregateAsyncWithinEither, but only returns the Right results.

    sink

    used for the aggregation

    schedule

    signalling for when to stop the aggregation

    returns

    ZStream[R1 with Clock, E2, B]

  17. def aggregateAsyncWithinEither[R1 <: R, E1 >: E, A1 >: A, B, C](sink: ⇒ ZSink[R1, E1, A1, A1, B], schedule: ⇒ Schedule[R1, Option[B], C])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, Either[C, B]]

    Permalink

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

    Aggregates elements using the provided sink until it completes, or until 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.

    sink

    used for the aggregation

    schedule

    signalling for when to stop the aggregation

    returns

    ZStream[R1 with Clock, E2, Either[C, B]]

  18. def as[A2](A2: ⇒ A2)(implicit trace: ZTraceElement): ZStream[R, E, A2]

    Permalink

    Maps the success values of this stream to the specified constant value.

  19. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  20. def branchAfter[R1 <: R, E1 >: E, B](n: Int)(f: (Chunk[A]) ⇒ ZPipeline[R1, E1, A, B])(implicit trace: ZTraceElement): ZStream[R1, E1, B]

    Permalink

    Reads the first n values from the stream and uses them to choose the pipeline that will be used for the remainder of the stream.

  21. final def broadcast(n: ⇒ Int, maximumLag: ⇒ Int)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Chunk[ZStream[Any, E, A]]]

    Permalink

    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 stream will only ever advance the maximumLag chunks before the slowest downstream stream.

  22. final def broadcastDynamic(maximumLag: ⇒ Int)(implicit trace: ZTraceElement): ZManaged[R, Nothing, ZStream[Any, E, A]]

    Permalink

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

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

  23. final def broadcastedQueues(n: ⇒ Int, maximumLag: ⇒ Int)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Chunk[Dequeue[Take[E, A]]]]

    Permalink

    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 chunks before the driver is back pressured.

    Queues can unsubscribe from upstream by shutting down.

  24. final def broadcastedQueuesDynamic(maximumLag: ⇒ Int)(implicit trace: ZTraceElement): ZManaged[R, Nothing, ZManaged[Any, Nothing, Dequeue[Take[E, A]]]]

    Permalink

    Converts the stream to a managed dynamic amount of queues.

    Converts the stream to a managed dynamic amount of queues. Every chunk will be replicated to every queue with the slowest queue being allowed to buffer maximumLag chunks before the driver is back pressured.

    Queues can unsubscribe from upstream by shutting down.

  25. final def buffer(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

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

    Note

    Prefer capacities that are powers of 2 for better performance.

    ,

    This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.

  26. final def bufferChunks(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[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.

  27. final def bufferChunksDropping(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

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

    Note

    Prefer capacities that are powers of 2 for better performance.

  28. final def bufferChunksSliding(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

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

    Note

    Prefer capacities that are powers of 2 for better performance.

  29. final def bufferDropping(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

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

    Note

    Prefer capacities that are powers of 2 for better performance.

    ,

    This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.

  30. final def bufferSliding(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

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

    Note

    Prefer capacities that are powers of 2 for better performance.

    ,

    This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.

  31. final def bufferUnbounded(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Allows a faster producer to progress independently of a slower consumer by buffering chunks into an unbounded queue.

  32. final def catchAll[R1 <: R, E2, A1 >: A](f: (E) ⇒ ZStream[R1, E2, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R1, E2, A1]

    Permalink

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

  33. final def catchAllCause[R1 <: R, E2, A1 >: A](f: (Cause[E]) ⇒ ZStream[R1, E2, A1])(implicit trace: ZTraceElement): ZStream[R1, E2, A1]

    Permalink

    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 causes of failure, including interruption if the stream is uninterruptible.

  34. final def catchSome[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[E, ZStream[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

  35. final def catchSomeCause[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[Cause[E], ZStream[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

    Switches over to the stream produced by the provided function in case this one fails with some errors. Allows recovery from all causes of failure, including interruption if the stream is uninterruptible.

  36. def changes(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Returns a new stream that only emits elements that are not equal to the previous element emitted, using natural equality to determine whether two elements are equal.

  37. def changesWith(f: (A, A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Returns a new stream that only emits elements that are not equal to the previous element emitted, using the specified function to determine whether two elements are equal.

  38. def changesWithZIO[R1 <: R, E1 >: E](f: (A, A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Returns a new stream that only emits elements that are not equal to the previous element emitted, using the specified effectual function to determine whether two elements are equal.

  39. val channel: ZChannel[R, Any, Any, Any, E, Chunk[A], Any]

    Permalink
  40. def chunks(implicit trace: ZTraceElement): ZStream[R, E, Chunk[A]]

    Permalink

    Exposes the underlying chunks of the stream as a stream of chunks of elements.

  41. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def collect[B](f: PartialFunction[A, B])(implicit trace: ZTraceElement): ZStream[R, E, B]

    Permalink

    Performs a filter and map in a single step.

  43. final def collectLeft[L1, A1](implicit ev: <:<[A, Either[L1, A1]], trace: ZTraceElement): ZStream[R, E, L1]

    Permalink

    Filters any Right values.

  44. final def collectRight[L1, A1](implicit ev: <:<[A, Either[L1, A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Filters any Left values.

  45. final def collectSome[A1](implicit ev: <:<[A, Option[A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Filters any 'None' values.

  46. final def collectSuccess[L1, A1](implicit ev: <:<[A, Exit[L1, A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Filters any Exit.Failure values.

  47. def collectWhile[A1](pf: PartialFunction[A, A1])(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

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

  48. final def collectWhileLeft[L1, A1](implicit ev: <:<[A, Either[L1, A1]], trace: ZTraceElement): ZStream[R, E, L1]

    Permalink

    Terminates the stream when encountering the first Right.

  49. final def collectWhileRight[L1, A1](implicit ev: <:<[A, Either[L1, A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Terminates the stream when encountering the first Left.

  50. final def collectWhileSome[A1](implicit ev: <:<[A, Option[A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Terminates the stream when encountering the first None.

  51. final def collectWhileSuccess[L1, A1](implicit ev: <:<[A, Exit[L1, A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Terminates the stream when encountering the first Exit.Failure.

  52. final def collectWhileZIO[R1 <: R, E1 >: E, A1](pf: PartialFunction[A, ZIO[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

  53. final def collectZIO[R1 <: R, E1 >: E, A1](pf: PartialFunction[A, ZIO[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Performs an effectful filter and map in a single step.

  54. final def combine[R1 <: R, E1 >: E, S, A2, A3](that: ⇒ ZStream[R1, E1, A2])(s: ⇒ S)(f: (S, ZIO[R, Option[E], A], ZIO[R1, Option[E1], A2]) ⇒ ZIO[R1, Nothing, Exit[Option[E1], (A3, S)]])(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    Combines the elements from this stream and the specified stream by repeatedly applying the function f to extract an element using both sides and conceptually "offer" it to the destination stream.

    Combines the elements from this stream and the specified stream by repeatedly applying the function f to extract an element using both sides and conceptually "offer" it to the destination stream. f can maintain some internal state to control the combining process, with the initial state being specified by s.

    Where possible, prefer ZStream#combineChunks for a more efficient implementation.

  55. final def combineChunks[R1 <: R, E1 >: E, S, A2, A3](that: ⇒ ZStream[R1, E1, A2])(s: ⇒ S)(f: (S, ZIO[R, Option[E], Chunk[A]], ZIO[R1, Option[E1], Chunk[A2]]) ⇒ ZIO[R1, Nothing, Exit[Option[E1], (Chunk[A3], S)]])(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    Combines the chunks from this stream and the specified stream by repeatedly applying the function f to extract a chunk using both sides and conceptually "offer" it to the destination stream.

    Combines the chunks from this stream and the specified stream by repeatedly applying the function f to extract a chunk using both sides and conceptually "offer" it to the destination stream. f can maintain some internal state to control the combining process, with the initial state being specified by s.

  56. def concat[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Concatenates the specified stream with this stream, resulting in a stream that emits the elements from this stream and then the elements from the specified stream.

  57. final def cross[R1 <: R, E1 >: E, B](that: ⇒ ZStream[R1, E1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): ZStream[R1, E1, Out]

    Permalink

    Composes this stream with the specified stream to create a cartesian product of elements.

    Composes this stream with the specified stream to create a cartesian product of elements. The that stream would be run multiple times, for every element in the this stream.

    See also ZStream#zip and ZStream#<&> for the more common point-wise variant.

  58. final def crossLeft[R1 <: R, E1 >: E, B](that: ⇒ ZStream[R1, E1, B])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Composes this stream with the specified stream to create a cartesian product of elements, but keeps only elements from this stream.

    Composes this stream with the specified stream to create a cartesian product of elements, but keeps only elements from this stream. The that stream would be run multiple times, for every element in the this stream.

    See also ZStream#zip and ZStream#<&> for the more common point-wise variant.

  59. def crossRight[R1 <: R, E1 >: E, B](that: ⇒ ZStream[R1, E1, B])(implicit trace: ZTraceElement): ZStream[R1, E1, B]

    Permalink

    Composes this stream with the specified stream to create a cartesian product of elements, but keeps only elements from the other stream.

    Composes this stream with the specified stream to create a cartesian product of elements, but keeps only elements from the other stream. The that stream would be run multiple times, for every element in the this stream.

    See also ZStream#zip and ZStream#<&> for the more common point-wise variant.

  60. final def crossWith[R1 <: R, E1 >: E, A2, C](that: ⇒ ZStream[R1, E1, A2])(f: (A, A2) ⇒ C)(implicit trace: ZTraceElement): ZStream[R1, E1, C]

    Permalink

    Composes this stream with the specified stream to create a cartesian product of elements with a specified function.

    Composes this stream with the specified stream to create a cartesian product of elements with a specified function. The that stream would be run multiple times, for every element in the this stream.

    See also ZStream#zip and ZStream#<&> for the more common point-wise variant.

  61. final def debounce(d: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

    Delays the emission of values by holding new values for a set duration.

    Delays the emission of values by holding new values for a set duration. If no new values arrive during that time the value is emitted, however if a new value is received during the holding period the previous value is discarded and the process is repeated with the new value.

    This operator is useful if you have a stream of "bursty" events which eventually settle down and you only need the final event of the burst.

    Example:
    1. A search engine may only want to initiate a search after a user has paused typing so as to not prematurely recommend results.

  62. final def defaultIfEmpty[R1 <: R, E1 >: E, A1 >: A](stream: ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Switches to the provided stream in case this one is empty.

  63. final def defaultIfEmpty[A1 >: A](chunk: Chunk[A1])(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Produces the specified chunk if this stream is empty.

  64. final def defaultIfEmpty[A1 >: A](a: A1)(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Produces the specified element if this stream is empty.

  65. final def distributedWith[E1 >: E](n: ⇒ Int, maximumLag: ⇒ Int, decide: (A) ⇒ UIO[(Int) ⇒ Boolean])(implicit trace: ZTraceElement): ZManaged[R, Nothing, List[Dequeue[Exit[Option[E1], A]]]]

    Permalink

    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. The decide function will receive the indices of the queues in the resulting list.

  66. final def distributedWithDynamic(maximumLag: ⇒ Int, decide: (A) ⇒ UIO[(UniqueKey) ⇒ Boolean], done: (Exit[Option[E], Nothing]) ⇒ UIO[Any] = (_: Any) => UIO.unit)(implicit trace: ZTraceElement): ZManaged[R, Nothing, UIO[(UniqueKey, Dequeue[Exit[Option[E], A]])]]

    Permalink

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

  67. final def drain(implicit trace: ZTraceElement): ZStream[R, E, Nothing]

    Permalink

    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.fromZIO(ZIO(println("Done!"))).drain ++
      Stream(4, 5, 6).tap(i => ZIO(println(i)))).run(Sink.drain)
  68. final def drainFork[R1 <: R, E1 >: E](other: ⇒ ZStream[R1, E1, Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Drains the provided stream in the background for as long as this stream is running.

    Drains the provided stream in the background for as long as this stream is running. If this stream ends before other, other will be interrupted. If other fails, this stream will fail with that error.

  69. def drop(n: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Drops the specified number of elements from this stream.

  70. def dropRight(n: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Drops the last specified number of elements from this stream.

    Drops the last specified number of elements from this stream.

    Note

    This combinator keeps n elements in memory. Be careful with big numbers.

  71. final def dropUntil(pred: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Drops all elements of the stream until the specified predicate evaluates to true.

  72. final def dropWhile(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

  73. final def dropWhileZIO[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Drops all elements of the stream for as long as the specified predicate produces an effect that evalutates to true

    Drops all elements of the stream for as long as the specified predicate produces an effect that evalutates to true

    See also

    dropWhile

  74. final def either(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, Nothing, Either[E, A]]

    Permalink

    Returns a stream whose failures and successes have been lifted into an Either.

    Returns a stream whose failures and successes have been lifted into an Either. The resulting stream cannot fail, because the failures have been exposed as part of the Either success case.

    Note

    the stream will end as soon as the first error occurs.

  75. final def ensuring[R1 <: R](fin: ⇒ ZIO[R1, Nothing, Any])(implicit trace: ZTraceElement): ZStream[R1, E, A]

    Permalink

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  78. final def filter(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Filters the elements emitted by this stream using the provided function.

  79. final def filterNot(pred: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

  80. def filterZIO[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Effectfully filters the elements emitted by this stream.

  81. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  82. final def find(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Finds the first element emitted by this stream that satisfies the provided predicate.

  83. final def findZIO[R1 <: R, E1 >: E, S](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Finds the first element emitted by this stream that satisfies the provided effectful predicate.

  84. final def fixed(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

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

  85. final def flatMap[R1 <: R, E1 >: E, B](f: (A) ⇒ ZStream[R1, E1, B])(implicit trace: ZTraceElement): ZStream[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

  86. def flatMapPar[R1 <: R, E1 >: E, B](n: ⇒ Int, bufferSize: ⇒ Int = 16)(f: (A) ⇒ ZStream[R1, E1, B])(implicit trace: ZTraceElement): ZStream[R1, E1, B]

    Permalink

    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 bufferSize elements of the produced streams may be buffered in memory by this operator.

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

    Permalink

    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.

  88. def flatten[R1 <: R, E1 >: E, A1](implicit ev: <:<[A, ZStream[R1, E1, A1]], trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Flattens this stream-of-streams into a stream made of the concatenation in strict order of all the streams.

  89. def flattenChunks[A1](implicit ev: <:<[A, Chunk[A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Submerges the chunks carried by this stream into the stream's structure, while still preserving them.

  90. def flattenExit[E1 >: E, A1](implicit ev: <:<[A, Exit[E1, A1]], trace: ZTraceElement): ZStream[R, E1, A1]

    Permalink

    Flattens Exit values.

    Flattens Exit values. Exit.Failure values translate to stream failures while Exit.Success values translate to stream elements.

  91. def flattenExitOption[E1 >: E, A1](implicit ev: <:<[A, Exit[Option[E1], A1]], trace: ZTraceElement): ZStream[R, E1, A1]

    Permalink

    Unwraps Exit values that also signify end-of-stream by failing with None.

    Unwraps Exit values that also signify end-of-stream by failing with None.

    For Exit[E, A] values that do not signal end-of-stream, prefer:

    stream.mapZIO(ZIO.done(_))
  92. def flattenIterables[A1](implicit ev: <:<[A, Iterable[A1]], trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Submerges the iterables carried by this stream into the stream's structure, while still preserving them.

  93. def flattenPar[R1 <: R, E1 >: E, A1](n: ⇒ Int, outputBuffer: ⇒ Int = 16)(implicit ev: <:<[A, ZStream[R1, E1, A1]], trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Flattens a stream of streams into a stream by executing a non-deterministic concurrent merge.

    Flattens a stream of streams into a stream by executing a non-deterministic concurrent merge. Up to n streams may be consumed in parallel and up to outputBuffer elements may be buffered by this operator.

  94. def flattenParUnbounded[R1 <: R, E1 >: E, A1](outputBuffer: ⇒ Int = 16)(implicit ev: <:<[A, ZStream[R1, E1, A1]], trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Like flattenPar, but executes all streams concurrently.

  95. final def flattenTake[E1 >: E, A1](implicit ev: <:<[A, Take[E1, A1]], trace: ZTraceElement): ZStream[R, E1, A1]

    Permalink

    Unwraps Exit values and flatten chunks that also signify end-of-stream by failing with None.

  96. final def foreach[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

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

  97. def forever(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Repeats this stream forever.

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

    Permalink
    Definition Classes
    AnyRef → Any
  99. final def groupAdjacentBy[K](f: (A) ⇒ K)(implicit trace: ZTraceElement): ZStream[R, E, (K, NonEmptyChunk[A])]

    Permalink

    Creates a pipeline that groups on adjacent keys, calculated by function f.

  100. final def groupBy[R1 <: R, E1 >: E, K, V](f: (A) ⇒ ZIO[R1, E1, (K, V)], buffer0: ⇒ Int = 16): GroupBy[R1, E1, K, V]

    Permalink

    More powerful version of ZStream.groupByKey

  101. final def groupByKey[K](f: (A) ⇒ K, buffer: ⇒ Int = 16): GroupBy[R, E, K, A]

    Permalink

    Partition a stream using a function and process each stream individually.

    Partition a stream using a function and process each stream individually. This returns a data structure that can be used to further filter down which groups shall be processed.

    After calling apply on the GroupBy object, the remaining groups will be processed in parallel and the resulting streams merged in a nondeterministic fashion.

    Up to buffer elements may be buffered in any group stream before the producer is backpressured. Take care to consume from all streams in order to prevent deadlocks.

    Example: Collect the first 2 words for every starting letter from a stream of words.

    ZStream.fromIterable(List("hello", "world", "hi", "holla"))
      .groupByKey(_.head) { case (k, s) => s.take(2).map((k, _)) }
      .runCollect
      .map(_ == List(('h', "hello"), ('h', "hi"), ('w', "world"))
  102. def grouped(chunkSize: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, Chunk[A]]

    Permalink

    Partitions the stream with specified chunkSize

    Partitions the stream with specified chunkSize

    chunkSize

    size of the chunk

  103. def groupedWithin(chunkSize: ⇒ Int, within: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, Chunk[A]]

    Permalink

    Partitions the stream with the specified chunkSize or until the specified duration has passed, whichever is satisfied first.

  104. final def haltAfter(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

    Specialized version of haltWhen which halts the evaluation of this stream after the given duration.

    Specialized version of haltWhen which halts the evaluation of this stream after the given duration.

    An element in the process of being pulled will not be interrupted when the given duration completes. See interruptAfter for this behavior.

  105. final def haltWhen[E1 >: E](p: Promise[E1, _])(implicit trace: ZTraceElement): ZStream[R, E1, A]

    Permalink

    Halts the evaluation of this stream when the provided promise resolves.

    Halts the evaluation of this stream when the provided promise resolves.

    If the promise completes with a failure, the stream will emit that failure.

  106. final def haltWhen[R1 <: R, E1 >: E](io: ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Halts the evaluation of this stream when the provided IO completes.

    Halts the evaluation of this stream when the provided IO completes. The given IO will be forked as part of the returned stream, and its success will be discarded.

    An element in the process of being pulled will not be interrupted when the IO completes. See interruptWhen for this behavior.

    If the IO completes with a failure, the stream will emit that failure.

  107. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  108. final def interleave[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    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.

  109. final def interleaveWith[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(b: ⇒ ZStream[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    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.

  110. final def interruptAfter(duration: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

    Specialized version of interruptWhen which interrupts the evaluation of this stream after the given duration.

  111. final def interruptWhen[E1 >: E](p: Promise[E1, _])(implicit trace: ZTraceElement): ZStream[R, E1, A]

    Permalink

    Interrupts the evaluation of this stream when the provided promise resolves.

    Interrupts the evaluation of this stream when the provided promise resolves. This combinator will also interrupt any in-progress element being pulled from upstream.

    If the promise completes with a failure, the stream will emit that failure.

  112. final def interruptWhen[R1 <: R, E1 >: E](io: ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Interrupts the evaluation of this stream when the provided IO completes.

    Interrupts the evaluation of this stream when the provided IO completes. The given IO will be forked as part of this stream, and its success will be discarded. This combinator will also interrupt any in-progress element being pulled from upstream.

    If the IO completes with a failure before the stream completes, the returned stream will emit that failure.

  113. final def intersperse[A1 >: A](start: ⇒ A1, middle: ⇒ A1, end: ⇒ A1)(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Intersperse and also add a prefix and a suffix

  114. final def intersperse[A1 >: A](middle: ⇒ A1)(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Intersperse stream with provided element similar to List.mkString.

    Intersperse stream with provided element similar to List.mkString.

  115. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  116. final def map[B](f: (A) ⇒ B)(implicit trace: ZTraceElement): ZStream[R, E, B]

    Permalink

    Transforms the elements of this stream using the supplied function.

  117. def mapAccum[S, A1](s: ⇒ S)(f: (S, A) ⇒ (S, A1))(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

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

  118. final def mapAccumZIO[R1 <: R, E1 >: E, S, A1](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, (S, A1)])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

  119. def mapBoth[E1, A1](f: (E) ⇒ E1, g: (A) ⇒ A1)(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, E1, A1]

    Permalink

    Returns a stream whose failure and success channels have been mapped by the specified pair of functions, f and g.

  120. def mapChunks[A2](f: (Chunk[A]) ⇒ Chunk[A2])(implicit trace: ZTraceElement): ZStream[R, E, A2]

    Permalink

    Transforms the chunks emitted by this stream.

  121. def mapChunksZIO[R1 <: R, E1 >: E, A2](f: (Chunk[A]) ⇒ ZIO[R1, E1, Chunk[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Effectfully transforms the chunks emitted by this stream.

  122. def mapConcat[A2](f: (A) ⇒ Iterable[A2])(implicit trace: ZTraceElement): ZStream[R, E, A2]

    Permalink

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

  123. def mapConcatChunk[A2](f: (A) ⇒ Chunk[A2])(implicit trace: ZTraceElement): ZStream[R, E, A2]

    Permalink

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

  124. final def mapConcatChunkZIO[R1 <: R, E1 >: E, A2](f: (A) ⇒ ZIO[R1, E1, Chunk[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

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

  125. final def mapConcatZIO[R1 <: R, E1 >: E, A2](f: (A) ⇒ ZIO[R1, E1, Iterable[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Effectfully maps each element to an iterable, and flattens the iterables into the output of this stream.

  126. def mapError[E2](f: (E) ⇒ E2)(implicit trace: ZTraceElement): ZStream[R, E2, A]

    Permalink

    Transforms the errors emitted by this stream using f.

  127. def mapErrorCause[E2](f: (Cause[E]) ⇒ Cause[E2])(implicit trace: ZTraceElement): ZStream[R, E2, A]

    Permalink

    Transforms the full causes of failures emitted by this stream.

  128. def mapZIO[R1 <: R, E1 >: E, A1](f: (A) ⇒ ZIO[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

  129. final def mapZIOPar[R1 <: R, E1 >: E, A2](n: ⇒ Int)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    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.

    Note

    This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.

  130. final def mapZIOParUnordered[R1 <: R, E1 >: E, A2](n: ⇒ Int)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    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.

  131. final def mapZIOPartitioned[R1 <: R, E1 >: E, A2, K](keyBy: (A) ⇒ K, buffer: ⇒ Int = 16)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Maps over elements of the stream with the specified effectful function, partitioned by p executing invocations of f concurrently.

    Maps over elements of the stream with the specified effectful function, partitioned by p executing invocations of f concurrently. The number of concurrent invocations of f is determined by the number of different outputs of type K. Up to buffer elements may be buffered per partition. Transformed elements may be reordered but the order within a partition is maintained.

  132. final def merge[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1], strategy: ⇒ TerminationStrategy = TerminationStrategy.Both)(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Merges this stream and the specified stream together.

    Merges this stream and the specified stream together.

    New produced stream will terminate when both specified stream terminate if no termination strategy is specified.

  133. final def mergeEither[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, Either[A, A2]]

    Permalink

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

  134. final def mergeLeft[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2], strategy: TerminationStrategy = TerminationStrategy.Both)(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Merges this stream and the specified stream together, discarding the values from the right stream.

  135. final def mergeRight[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2], strategy: TerminationStrategy = TerminationStrategy.Both)(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Merges this stream and the specified stream together, discarding the values from the left stream.

  136. final def mergeTerminateEither[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Merges this stream and the specified stream together.

    Merges this stream and the specified stream together. New produced stream will terminate when either stream terminates.

  137. final def mergeTerminateLeft[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Merges this stream and the specified stream together.

    Merges this stream and the specified stream together. New produced stream will terminate when this stream terminates.

  138. final def mergeTerminateRight[R1 <: R, E1 >: E, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Merges this stream and the specified stream together.

    Merges this stream and the specified stream together. New produced stream will terminate when the specified stream terminates.

  139. final def mergeWith[R1 <: R, E1 >: E, A2, A3](that: ⇒ ZStream[R1, E1, A2], strategy: ⇒ TerminationStrategy = TerminationStrategy.Both)(l: (A) ⇒ A3, r: (A2) ⇒ A3)(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

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

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

    New produced stream will terminate when both specified stream terminate if no termination strategy is specified.

  140. final def mkString(before: ⇒ String, middle: ⇒ String, after: ⇒ String)(implicit trace: ZTraceElement): ZIO[R, E, String]

    Permalink

    Returns a combined string resulting from concatenating each of the values from the stream beginning with before interspersed with middle and ending with after.

  141. final def mkString(implicit trace: ZTraceElement): ZIO[R, E, String]

    Permalink

    Returns a combined string resulting from concatenating each of the values from the stream

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

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

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

    Permalink
    Definition Classes
    AnyRef
  145. final def onError[R1 <: R](cleanup: (Cause[E]) ⇒ URIO[R1, Any])(implicit trace: ZTraceElement): ZStream[R1, E, A]

    Permalink

    Runs the specified effect if this stream fails, providing the error to the effect if it exists.

    Runs the specified effect if this stream fails, providing the error to the effect if it exists.

    Note: Unlike ZIO.onError, there is no guarantee that the provided effect will not be interrupted.

  146. def onExecutor(executor: ⇒ Executor)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Locks the execution of this stream to the specified executor.

    Locks the execution of this stream to the specified executor. Any streams that are composed after this one will automatically be shifted back to the previous executor.

  147. def orElse[R1 <: R, E1, A1 >: A](that: ⇒ ZStream[R1, E1, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    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.

  148. final def orElseEither[R1 <: R, E2, A2](that: ⇒ ZStream[R1, E2, A2])(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R1, E2, Either[A, A2]]

    Permalink

    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.

  149. final def orElseFail[E1](e1: ⇒ E1)(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, E1, A]

    Permalink

    Fails with given error in case this one fails with a typed error.

    Fails with given error in case this one fails with a typed error.

    See also ZStream#catchAll.

  150. final def orElseOptional[R1 <: R, E1, A1 >: A](that: ⇒ ZStream[R1, Option[E1], A1])(implicit ev: <:<[E, Option[E1]], trace: ZTraceElement): ZStream[R1, Option[E1], A1]

    Permalink

    Switches to the provided stream in case this one fails with the None value.

    Switches to the provided stream in case this one fails with the None value.

    See also ZStream#catchAll.

  151. final def orElseSucceed[A1 >: A](A1: ⇒ A1)(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, Nothing, A1]

    Permalink

    Succeeds with the specified value if this one fails with a typed error.

  152. def partition(p: (A) ⇒ Boolean, buffer: ⇒ Int = 16)(implicit trace: ZTraceElement): ZManaged[R, E, (ZStream[Any, E, A], ZStream[Any, E, A])]

    Permalink

    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.

  153. final def partitionEither[R1 <: R, E1 >: E, A2, A3](p: (A) ⇒ ZIO[R1, E1, Either[A2, A3]], buffer: ⇒ Int = 16)(implicit trace: ZTraceElement): ZManaged[R1, E1, (ZStream[Any, E1, A2], ZStream[Any, E1, A3])]

    Permalink

    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.

  154. def peel[R1 <: R, E1 >: E, A1 >: A, Z](sink: ⇒ ZSink[R1, E1, A1, A1, Z])(implicit trace: ZTraceElement): ZManaged[R1, E1, (Z, ZStream[Any, E, A1])]

    Permalink

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

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

  155. def pipeThrough[R1 <: R, E1 >: E, L, Z](sink: ⇒ ZSink[R1, E1, A, L, Z])(implicit trace: ZTraceElement): ZStream[R1, E1, L]

    Permalink

    Pipes all of the values from this stream through the provided sink.

    Pipes all of the values from this stream through the provided sink.

    See also

    transduce

  156. def pipeThroughChannel[R1 <: R, E2, A2](channel: ⇒ ZChannel[R1, E, Chunk[A], Any, E2, Chunk[A2], Any])(implicit trace: ZTraceElement): ZStream[R1, E2, A2]

    Permalink

    Pipes all the values from this stream through the provided channel

  157. def pipeThroughChannelOrFail[R1 <: R, E1 >: E, A2](channel: ZChannel[R1, Nothing, Chunk[A], Any, E1, Chunk[A2], Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Pipes all values from this stream through the provided channel, passing through any error emitted by this stream unchanged.

  158. def provideCustomLayer[E1 >: E, R1](layer: ⇒ ZLayer[ZEnv, E1, R1])(implicit ev: <:<[ZEnv with R1, R], tagged: zio.EnvironmentTag[R1], trace: ZTraceElement): ZStream[ZEnv, E1, A]

    Permalink

    Provides the part of the environment that is not part of the ZEnv, leaving a stream that only depends on the ZEnv.

    Provides the part of the environment that is not part of the ZEnv, leaving a stream that only depends on the ZEnv.

    val loggingLayer: ZLayer[Any, Nothing, Logging] = ???
    
    val stream: ZStream[ZEnv with Logging, Nothing, Unit] = ???
    
    val stream2 = stream.provideCustomLayer(loggingLayer)
  159. final def provideEnvironment(r: ⇒ ZEnvironment[R])(implicit ev: NeedsEnv[R], trace: ZTraceElement): ZStream[Any, E, A]

    Permalink

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

  160. final def provideLayer[E1 >: E, R0](layer: ⇒ ZLayer[R0, E1, R])(implicit trace: ZTraceElement): ZStream[R0, E1, A]

    Permalink

    Provides a layer to the stream, which translates it to another level.

  161. final def provideService[Service <: R](service: Service)(implicit ev1: NeedsEnv[R], tag: Tag[Service], trace: ZTraceElement): ZStream[Any, E, A]

    Permalink

    Provides the stream with the single service it requires.

    Provides the stream with the single service it requires. If the stream requires multiple services use provideEnvironment instead.

  162. final def provideSomeEnvironment[R0](env: (ZEnvironment[R0]) ⇒ ZEnvironment[R])(implicit ev: NeedsEnv[R], trace: ZTraceElement): ZStream[R0, E, A]

    Permalink

    Transforms the environment being provided to the stream with the specified function.

  163. final def provideSomeLayer[R0]: ProvideSomeLayer[R0, R, E, A]

    Permalink

    Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

    Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

    val clockLayer: ZLayer[Any, Nothing, Clock] = ???
    
    val stream: ZStream[Clock with Random, Nothing, Unit] = ???
    
    val stream2 = stream.provideSomeLayer[Random](clockLayer)
  164. def rechunk(n: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Re-chunks the elements of the stream into chunks of n elements each.

    Re-chunks the elements of the stream into chunks of n elements each. The last chunk might contain less than n elements

  165. final def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: <:<[E, Throwable], ev2: CanFail[E], trace: ZTraceElement): ZStream[R, E1, A]

    Permalink

    Keeps some of the errors, and terminates the fiber with the rest

  166. final def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: (E) ⇒ Throwable)(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, E1, A]

    Permalink

    Keeps some of the errors, and terminates the fiber with the rest, using the specified function to convert the E into a Throwable.

  167. final def repeat[R1 <: R, B](schedule: ⇒ Schedule[R1, Any, B])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, A]

    Permalink

    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.

  168. final def repeatEither[R1 <: R, B](schedule: ⇒ Schedule[R1, Any, B])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, Either[B, A]]

    Permalink

    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. The schedule output will be emitted at the end of each repetition.

  169. final def repeatElements[R1 <: R](schedule: ⇒ Schedule[R1, A, Any])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, A]

    Permalink

    Repeats each element of the stream using the provided schedule.

    Repeats each element of the stream using the provided schedule. Repetitions are done in addition to the first execution, which means using Schedule.recurs(1) actually results in the original effect, plus an additional recurrence, for a total of two repetitions of each value in the stream.

  170. final def repeatElementsEither[R1 <: R, E1 >: E, B](schedule: ⇒ Schedule[R1, A, B])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, Either[B, A]]

    Permalink

    Repeats each element of the stream using the provided schedule.

    Repeats each element of the stream using the provided schedule. When the schedule is finished, then the output of the schedule will be emitted into the stream. Repetitions are done in addition to the first execution, which means using Schedule.recurs(1) actually results in the original effect, plus an additional recurrence, for a total of two repetitions of each value in the stream.

  171. final def repeatElementsWith[R1 <: R, E1 >: E, B, C](schedule: ⇒ Schedule[R1, A, B])(f: (A) ⇒ C, g: (B) ⇒ C)(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, C]

    Permalink

    Repeats each element of the stream using the provided schedule.

    Repeats each element of the stream using the provided schedule. When the schedule is finished, then the output of the schedule will be emitted into the stream. Repetitions are done in addition to the first execution, which means using Schedule.recurs(1) actually results in the original effect, plus an additional recurrence, for a total of two repetitions of each value in the stream.

    This function accepts two conversion functions, which allow the output of this stream and the output of the provided schedule to be unified into a single type. For example, Either or similar data type.

  172. final def repeatWith[R1 <: R, B, C](schedule: ⇒ Schedule[R1, Any, B])(f: (A) ⇒ C, g: (B) ⇒ C)(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, C]

    Permalink

    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. The schedule output will be emitted at the end of each repetition and can be unified with the stream elements using the provided functions.

  173. def retry[R1 <: R](schedule: ⇒ Schedule[R1, E, _])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, A]

    Permalink

    When the stream fails, retry it according to the given schedule

    When the stream fails, retry it according to the given schedule

    This retries the entire stream, so will re-execute all of the stream's acquire operations.

    The schedule is reset as soon as the first element passes through the stream again.

    schedule

    Schedule receiving as input the errors of the stream

    returns

    Stream outputting elements of all attempts of the stream

  174. final def right[A1, A2](implicit ev: <:<[A, Either[A1, A2]], trace: ZTraceElement): ZStream[R, Option[E], A2]

    Permalink

    Fails with the error None if value is Left.

  175. final def rightOrFail[A1, A2, E1 >: E](e: ⇒ E1)(implicit ev: <:<[A, Either[A1, A2]], trace: ZTraceElement): ZStream[R, E1, A2]

    Permalink

    Fails with given error 'e' if value is Left.

  176. def run[R1 <: R, E1 >: E, Z](sink: ⇒ ZSink[R1, E1, A, Any, Z])(implicit trace: ZTraceElement): ZIO[R1, E1, Z]

    Permalink

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

  177. def runCollect(implicit trace: ZTraceElement): ZIO[R, E, Chunk[A]]

    Permalink

    Runs the stream and collects all of its elements to a chunk.

  178. final def runCount(implicit trace: ZTraceElement): ZIO[R, E, Long]

    Permalink

    Runs the stream and emits the number of elements processed

    Runs the stream and emits the number of elements processed

    Equivalent to run(ZSink.count)

  179. def runDrain(implicit trace: ZTraceElement): ZIO[R, E, Unit]

    Permalink

    Runs the stream only for its effects.

    Runs the stream only for its effects. The emitted elements are discarded.

  180. final def runFold[S](s: ⇒ S)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZIO[R, E, S]

    Permalink

    Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type S.

  181. final def runFoldManaged[S](s: ⇒ S)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZManaged[R, E, S]

    Permalink

    Executes a pure fold over the stream of values.

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

  182. final def runFoldManagedZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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.

  183. final def runFoldWhile[S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZIO[R, E, S]

    Permalink

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

    Reduces the elements in the stream to a value of type S. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1).forever.foldWhile(0)(_ <= 4)(_ + _) // UIO[Int] == 5
  184. final def runFoldWhileManaged[S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZManaged[R, E, S]

    Permalink

    Executes a pure fold over the stream of values.

    Executes a pure fold over the stream of values. Returns a Managed value that represents the scope of the stream. Stops the fold early when the condition is not fulfilled.

  185. final def runFoldWhileManagedZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // Managed[Nothing, Int]
      .use(ZIO.succeed)                       // UIO[Int] == 5
    cont

    function which defines the early termination condition

  186. final def runFoldWhileZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // UIO[Int] == 5
    cont

    function which defines the early termination condition

  187. final def runFoldZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

  188. final def runForeach[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

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

  189. final def runForeachChunk[R1 <: R, E1 >: E](f: (Chunk[A]) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

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

  190. final def runForeachChunkManaged[R1 <: R, E1 >: E](f: (Chunk[A]) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  191. final def runForeachManaged[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  192. final def runForeachWhile[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

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

  193. final def runForeachWhileManaged[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  194. def runHead(implicit trace: ZTraceElement): ZIO[R, E, Option[A]]

    Permalink

    Runs the stream to completion and yields the first value emitted by it, discarding the rest of the elements.

  195. final def runIntoHub[R1 <: R, E1 >: E](hub: ⇒ ZHub[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

    Publishes elements of this stream to a hub.

    Publishes elements of this stream to a hub. Stream failure and ending will also be signalled.

  196. final def runIntoHubManaged[R1 <: R, E1 >: E](hub: ⇒ ZHub[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  197. final def runIntoQueue[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

    Enqueues elements of this stream into a queue.

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

  198. final def runIntoQueueElementsManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Exit[Option[E1], A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  199. final def runIntoQueueManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

  200. def runLast(implicit trace: ZTraceElement): ZIO[R, E, Option[A]]

    Permalink

    Runs the stream to completion and yields the last value emitted by it, discarding the rest of the elements.

  201. def runManaged[R1 <: R, E1 >: E, B](sink: ⇒ ZSink[R1, E1, A, Any, B])(implicit trace: ZTraceElement): ZManaged[R1, E1, B]

    Permalink
  202. final def runSum[A1 >: A](implicit ev: Numeric[A1], trace: ZTraceElement): ZIO[R, E, A1]

    Permalink

    Runs the stream to a sink which sums elements, provided they are Numeric.

    Runs the stream to a sink which sums elements, provided they are Numeric.

    Equivalent to run(Sink.sum[A])

  203. def scan[S](s: ⇒ S)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZStream[R, E, S]

    Permalink

    Statefully maps over the elements of this stream to produce all intermediate results of type S given an initial S.

  204. def scanReduce[A1 >: A](f: (A1, A) ⇒ A1)(implicit trace: ZTraceElement): ZStream[R, E, A1]

    Permalink

    Statefully maps over the elements of this stream to produce all intermediate results.

    Statefully maps over the elements of this stream to produce all intermediate results.

    See also ZStream#scan.

  205. def scanReduceZIO[R1 <: R, E1 >: E, A1 >: A](f: (A1, A) ⇒ ZIO[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results.

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results.

    See also ZStream#scanM.

  206. def scanZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZStream[R1, E1, S]

    Permalink

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results of type S given an initial S.

  207. final def schedule[R1 <: R](schedule: ⇒ Schedule[R1, A, Any])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E, A]

    Permalink

    Schedules the output of the stream using the provided schedule.

  208. final def scheduleEither[R1 <: R, E1 >: E, B](schedule: ⇒ Schedule[R1, A, B])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, Either[B, A]]

    Permalink

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

  209. final def scheduleWith[R1 <: R, E1 >: E, B, C](schedule: ⇒ Schedule[R1, A, B])(f: (A) ⇒ C, g: (B) ⇒ C)(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, C]

    Permalink

    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.

  210. def sliding(chunkSize: ⇒ Int, stepSize: Int = 1)(implicit trace: ZTraceElement): ZStream[R, E, Chunk[A]]

    Permalink

    Emits a sliding window of n elements.

    Emits a sliding window of n elements.

    Stream(1, 2, 3, 4).sliding(2).runCollect // Chunk(Chunk(1, 2), Chunk(2, 3), Chunk(3, 4))
  211. final def some[A2](implicit ev: <:<[A, Option[A2]], trace: ZTraceElement): ZStream[R, Option[E], A2]

    Permalink

    Converts an option on values into an option on errors.

  212. final def someOrElse[A2](default: ⇒ A2)(implicit ev: <:<[A, Option[A2]], trace: ZTraceElement): ZStream[R, E, A2]

    Permalink

    Extracts the optional value, or returns the given 'default'.

  213. final def someOrFail[A2, E1 >: E](e: ⇒ E1)(implicit ev: <:<[A, Option[A2]], trace: ZTraceElement): ZStream[R, E1, A2]

    Permalink

    Extracts the optional value, or fails with the given error 'e'.

  214. final def split(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, Chunk[A]]

    Permalink

    Splits elements based on a predicate.

    Splits elements based on a predicate.

    ZStream.range(1, 10).split(_ % 4 == 0).runCollect // Chunk(Chunk(1, 2, 3), Chunk(5, 6, 7), Chunk(9))
  215. final def splitOnChunk[A1 >: A](delimiter: ⇒ Chunk[A1])(implicit trace: ZTraceElement): ZStream[R, E, Chunk[A]]

    Permalink

    Splits elements on a delimiter and transforms the splits into desired output.

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

    Permalink
    Definition Classes
    AnyRef
  217. def take(n: ⇒ Long)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Takes the specified number of elements from this stream.

  218. def takeRight(n: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Takes the last specified number of elements from this stream.

  219. def takeUntil(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Takes all elements of the stream until the specified predicate evaluates to true.

  220. def takeUntilZIO[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Takes all elements of the stream until the specified effectual predicate evaluates to true.

  221. def takeWhile(f: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

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

  222. final def tap[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

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

  223. final def tapError[R1 <: R, E1 >: E](f: (E) ⇒ ZIO[R1, E1, Any])(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Returns a stream that effectfully "peeks" at the failure of the stream.

  224. final def tapSink[R1 <: R, E1 >: E](sink: ⇒ ZSink[R1, E1, A, Any, Any])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Sends all elements emitted by this stream to the specified sink in addition to emitting them.

  225. final def throttleEnforce(units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ Long)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

    Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Throttles the chunks of this stream 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. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn function.

  226. final def throttleEnforceZIO[R1 <: R, E1 >: E](units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ ZIO[R1, E1, Long])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, A]

    Permalink

    Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Throttles the chunks of this stream 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. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn effectful function.

  227. final def throttleShape(units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ Long)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

    Delays the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Delays the chunks of this stream 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 chunk is determined by the costFn function.

  228. final def throttleShapeZIO[R1 <: R, E1 >: E](units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ ZIO[R1, E1, Long])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, A]

    Permalink

    Delays the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Delays the chunks of this stream 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 chunk is determined by the costFn effectful function.

  229. final def timeout(d: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E, A]

    Permalink

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

  230. final def timeoutFail[E1 >: E](e: ⇒ E1)(d: zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E1, A]

    Permalink

    Fails the stream with given error if it does not produce a value after d duration.

  231. final def timeoutFailCause[E1 >: E](cause: ⇒ Cause[E1])(d: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E1, A]

    Permalink

    Fails the stream with given cause if it does not produce a value after d duration.

  232. final def timeoutTo[R1 <: R, E1 >: E, A2 >: A](d: ⇒ zio.Duration)(that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, A2]

    Permalink

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

  233. def toHub(capacity: ⇒ Int)(implicit trace: ZTraceElement): ZManaged[R, Nothing, ZHub[Nothing, Any, Any, Nothing, Nothing, Take[E, A]]]

    Permalink

    Converts the stream to a managed hub of chunks.

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

  234. def toInputStream(implicit ev0: <:<[E, Throwable], ev1: <:<[A, Byte], trace: ZTraceElement): ZManaged[R, E, InputStream]

    Permalink

    Converts this stream of bytes into a java.io.InputStream wrapped in a ZManaged.

    Converts this stream of bytes into a java.io.InputStream wrapped in a ZManaged. The returned input stream will only be valid within the scope of the ZManaged.

  235. def toIterator(implicit trace: ZTraceElement): ZManaged[R, Nothing, Iterator[Either[E, A]]]

    Permalink

    Converts this stream into a scala.collection.Iterator wrapped in a ZManaged.

    Converts this stream into a scala.collection.Iterator wrapped in a ZManaged. The returned iterator will only be valid within the scope of the ZManaged.

  236. def toPull(implicit trace: ZTraceElement): ZManaged[R, Nothing, ZIO[R, Option[E], Chunk[A]]]

    Permalink
  237. final def toQueue(capacity: ⇒ Int = 2)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Dequeue[Take[E, A]]]

    Permalink

    Converts the stream to a managed queue of chunks.

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

  238. final def toQueueDropping(capacity: ⇒ Int = 2)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Dequeue[Take[E, A]]]

    Permalink

    Converts the stream to a dropping managed queue of chunks.

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

  239. final def toQueueOfElements(capacity: ⇒ Int = 2)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Dequeue[Exit[Option[E], A]]]

    Permalink

    Converts the stream to a managed queue of elements.

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

  240. final def toQueueSliding(capacity: ⇒ Int = 2)(implicit trace: ZTraceElement): ZManaged[R, Nothing, Dequeue[Take[E, A]]]

    Permalink

    Converts the stream to a sliding managed queue of chunks.

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

  241. final def toQueueUnbounded(implicit trace: ZTraceElement): ZManaged[R, Nothing, Dequeue[Take[E, A]]]

    Permalink

    Converts the stream into an unbounded managed queue.

    Converts the stream into an unbounded managed queue. After the managed queue is used, the queue will never again produce values and should be discarded.

  242. def toReader(implicit ev0: <:<[E, Throwable], ev1: <:<[A, Char], trace: ZTraceElement): ZManaged[R, E, Reader]

    Permalink

    Converts this stream of chars into a java.io.Reader wrapped in a ZManaged.

    Converts this stream of chars into a java.io.Reader wrapped in a ZManaged. The returned reader will only be valid within the scope of the ZManaged.

  243. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  244. def transduce[R1 <: R, E1 >: E, A1 >: A, Z](sink: ⇒ ZSink[R1, E1, A1, A1, Z])(implicit trace: ZTraceElement): ZStream[R1, E1, Z]

    Permalink

    Applies the transducer to the stream and emits its outputs.

  245. final def updateService[M]: UpdateService[R, E, A, M]

    Permalink

    Updates a service in the environment of this effect.

  246. final def updateServiceAt[Service]: UpdateServiceAt[R, E, A, Service]

    Permalink

    Updates a service at the specified key in the environment of this effect.

  247. def via[R1 <: R, E1 >: E, B](pipeline: ZPipeline[R1, E1, A, B])(implicit trace: ZTraceElement): ZStream[R1, E1, B]

    Permalink

    Threads the stream through a transformation pipeline.

  248. def viaFunction[R2, E2, B](f: (ZStream[R, E, A]) ⇒ ZStream[R2, E2, B])(implicit trace: ZTraceElement): ZStream[R2, E2, B]

    Permalink

    Threads the stream through the transformation function f.

  249. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  252. def when(b: ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Returns this stream if the specified condition is satisfied, otherwise returns an empty stream.

  253. def whenZIO[R1 <: R, E1 >: E](b: ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Returns this stream if the specified effectful condition is satisfied, otherwise returns an empty stream.

  254. def withFilter(predicate: (A) ⇒ Boolean)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Equivalent to filter but enables the use of filter clauses in for-comprehensions

  255. def withRuntimeConfig(runtimeConfig: ⇒ RuntimeConfig)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Runs this stream on the specified runtime configuration.

    Runs this stream on the specified runtime configuration. Any streams that are composed after this one will be run on the previous executor.

  256. def zip[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit zippable: Zippable[A, A2], trace: ZTraceElement): ZStream[R1, E1, Out]

    Permalink

    Zips this stream with another point-wise and emits tuples of elements from both streams.

    Zips this stream with another point-wise and emits tuples of elements from both streams.

    The new stream will end when one of the sides ends.

  257. def zipAll[R1 <: R, E1 >: E, A1 >: A, A2](that: ⇒ ZStream[R1, E1, A2])(defaultLeft: ⇒ A1, defaultRight: ⇒ A2)(implicit trace: ZTraceElement): ZStream[R1, E1, (A1, A2)]

    Permalink

    Zips this stream with another point-wise, creating a new stream of pairs of elements from both sides.

    Zips this stream with another point-wise, creating a new stream of pairs of elements from both sides.

    The defaults defaultLeft and defaultRight will be used if the streams have different lengths and one of the streams has ended before the other.

  258. def zipAllLeft[R1 <: R, E1 >: E, A1 >: A, A2](that: ⇒ ZStream[R1, E1, A2])(default: ⇒ A1)(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Zips this stream with another point-wise, and keeps only elements from this stream.

    Zips this stream with another point-wise, and keeps only elements from this stream.

    The provided default value will be used if the other stream ends before this one.

  259. def zipAllRight[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(default: ⇒ A2)(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Zips this stream with another point-wise, and keeps only elements from the other stream.

    Zips this stream with another point-wise, and keeps only elements from the other stream.

    The provided default value will be used if this stream ends before the other one.

  260. def zipAllWith[R1 <: R, E1 >: E, A2, A3](that: ⇒ ZStream[R1, E1, A2])(left: (A) ⇒ A3, right: (A2) ⇒ A3)(both: (A, A2) ⇒ A3)(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    Zips this stream with another point-wise.

    Zips this stream with another point-wise. The provided functions will be used to create elements for the composed stream.

    The functions left and right will be used if the streams have different lengths and one of the streams has ended before the other.

  261. def zipLeft[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Zips this stream with another point-wise, but keeps only the outputs of this stream.

    Zips this stream with another point-wise, but keeps only the outputs of this stream.

    The new stream will end when one of the sides ends.

  262. def zipRight[R1 <: R, E1 >: E, A2](that: ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Zips this stream with another point-wise, but keeps only the outputs of the other stream.

    Zips this stream with another point-wise, but keeps only the outputs of the other stream.

    The new stream will end when one of the sides ends.

  263. def zipWith[R1 <: R, E1 >: E, A2, A3](that: ⇒ ZStream[R1, E1, A2])(f: (A, A2) ⇒ A3)(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    Zips this stream with another point-wise and applies the function to the paired elements.

    Zips this stream with another point-wise and applies the function to the paired elements.

    The new stream will end when one of the sides ends.

  264. def zipWithChunks[R1 <: R, E1 >: E, A1 >: A, A2, A3](that: ⇒ ZStream[R1, E1, A2])(f: (Chunk[A1], Chunk[A2]) ⇒ (Chunk[A3], Either[Chunk[A1], Chunk[A2]]))(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    Zips this stream with another point-wise and applies the function to the paired elements.

    Zips this stream with another point-wise and applies the function to the paired elements.

    The new stream will end when one of the sides ends.

  265. final def zipWithIndex(implicit trace: ZTraceElement): ZStream[R, E, (A, Long)]

    Permalink

    Zips this stream together with the index of elements.

  266. final def zipWithLatest[R1 <: R, E1 >: E, A2, A3](that: ⇒ ZStream[R1, E1, A2])(f: (A, A2) ⇒ A3)(implicit trace: ZTraceElement): ZStream[R1, E1, A3]

    Permalink

    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.

    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.

    Note: tracking the latest value is done on a per-chunk basis. That means that emitted elements that are not the last value in chunks will never be used for zipping.

  267. final def zipWithNext(implicit trace: ZTraceElement): ZStream[R, E, (A, Option[A])]

    Permalink

    Zips each element with the next element if present.

  268. final def zipWithPrevious(implicit trace: ZTraceElement): ZStream[R, E, (Option[A], A)]

    Permalink

    Zips each element with the previous element.

    Zips each element with the previous element. Initially accompanied by None.

  269. final def zipWithPreviousAndNext(implicit trace: ZTraceElement): ZStream[R, E, (Option[A], A, Option[A])]

    Permalink

    Zips each element with both the previous and next element.

Deprecated Value Members

  1. def >>=[R1 <: R, E1 >: E, A2](f: (A) ⇒ ZStream[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Symbolic alias for ZStream#flatMap.

    Symbolic alias for ZStream#flatMap.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use flatMap

  2. def bimap[E1, A1](f: (E) ⇒ E1, g: (A) ⇒ A1)(implicit ev: CanFail[E], trace: ZTraceElement): ZStream[R, E1, A1]

    Permalink

    Returns a stream whose failure and success channels have been mapped by the specified pair of functions, f and g.

    Returns a stream whose failure and success channels have been mapped by the specified pair of functions, f and g.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapBoth

  3. def chunkN(n: ⇒ Int)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Re-chunks the elements of the stream into chunks of n elements each.

    Re-chunks the elements of the stream into chunks of n elements each. The last chunk might contain less than n elements

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use rechunk

  4. final def collectM[R1 <: R, E1 >: E, A1](pf: PartialFunction[A, ZIO[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Performs an effectful filter and map in a single step.

    Performs an effectful filter and map in a single step.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectZIO

  5. final def collectWhileM[R1 <: R, E1 >: E, A1](pf: PartialFunction[A, ZIO[R1, E1, A1]])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectWhileZIO

  6. final def dropWhileM[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Drops all elements of the stream for as long as the specified predicate produces an effect that evalutates to true

    Drops all elements of the stream for as long as the specified predicate produces an effect that evalutates to true

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use dropWhileZIO

    See also

    dropWhile

  7. def filterM[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Effectfully filters the elements emitted by this stream.

    Effectfully filters the elements emitted by this stream.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use filterZIO

  8. final def findM[R1 <: R, E1 >: E, S](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Finds the first element emitted by this stream that satisfies the provided effectful predicate.

    Finds the first element emitted by this stream that satisfies the provided effectful predicate.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use findZIO

  9. final def fold[S](s: ⇒ S)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZIO[R, E, S]

    Permalink

    Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type S.

    Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type S.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFold

  10. final def foldM[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldZIO

  11. final def foldManaged[S](s: ⇒ S)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZManaged[R, E, S]

    Permalink

    Executes a pure fold over the stream of values.

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) user runFoldManaged

  12. final def foldManagedM[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldManagedZIO

  13. final def foldManagedZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldManagedZIO

  14. final def foldWhile[S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZIO[R, E, S]

    Permalink

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

    Reduces the elements in the stream to a value of type S. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1).forever.foldWhile(0)(_ <= 4)(_ + _) // UIO[Int] == 5
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhile

  15. final def foldWhileM[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileZIO

  16. final def foldWhileManaged[S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ S)(implicit trace: ZTraceElement): ZManaged[R, E, S]

    Permalink

    Executes a pure fold over the stream of values.

    Executes a pure fold over the stream of values. Returns a Managed value that represents the scope of the stream. Stops the fold early when the condition is not fulfilled.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileManaged

  17. final def foldWhileManagedM[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // Managed[Nothing, Int]
      .use(ZIO.succeed)                       // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileManagedZIO

  18. final def foldWhileManagedZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // Managed[Nothing, Int]
      .use(ZIO.succeed)                       // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileManagedZIO

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

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileZIO

  20. final def foldZIO[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldZIO

  21. final def foreachChunk[R1 <: R, E1 >: E](f: (Chunk[A]) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runForeachChunk

  22. final def foreachChunkManaged[R1 <: R, E1 >: E](f: (Chunk[A]) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runForeachChunkManaged

  23. final def foreachManaged[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) run runForeachManaged

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

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runForeachWhile

  25. final def foreachWhileManaged[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runForeachWhileManaged

  26. final def intoHub[R1 <: R, E1 >: E](hub: ⇒ ZHub[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

    Publishes elements of this stream to a hub.

    Publishes elements of this stream to a hub. Stream failure and ending will also be signalled.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoHub

  27. final def intoHubManaged[R1 <: R, E1 >: E](hub: ⇒ ZHub[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoHubManaged

  28. final def intoManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueueManaged

  29. final def intoQueue[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

    Enqueues elements of this stream into a queue.

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueue

  30. final def intoQueueManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueueManaged

  31. def lock(executor: ⇒ Executor)(implicit trace: ZTraceElement): ZStream[R, E, A]

    Permalink

    Locks the execution of this stream to the specified executor.

    Locks the execution of this stream to the specified executor. Any streams that are composed after this one will automatically be shifted back to the previous executor.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use onExecutor

  32. final def mapAccumM[R1 <: R, E1 >: E, S, A1](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, (S, A1)])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapAccumZIO

  33. def mapChunksM[R1 <: R, E1 >: E, A2](f: (Chunk[A]) ⇒ ZIO[R1, E1, Chunk[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Effectfully transforms the chunks emitted by this stream.

    Effectfully transforms the chunks emitted by this stream.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapChunksZIO

  34. final def mapConcatChunkM[R1 <: R, E1 >: E, A2](f: (A) ⇒ ZIO[R1, E1, Chunk[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapConcatChunkZIO

  35. final def mapConcatM[R1 <: R, E1 >: E, A2](f: (A) ⇒ ZIO[R1, E1, Iterable[A2]])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Effectfully maps each element to an iterable, and flattens the iterables into the output of this stream.

    Effectfully maps each element to an iterable, and flattens the iterables into the output of this stream.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapConcatZIO

  36. def mapM[R1 <: R, E1 >: E, A1](f: (A) ⇒ ZIO[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIO

  37. final def mapMPar[R1 <: R, E1 >: E, A2](n: ⇒ Int)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIOPar

    Note

    This combinator destroys the chunking structure. It's recommended to use rechunk afterwards.

  38. final def mapMParUnordered[R1 <: R, E1 >: E, A2](n: ⇒ Int)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIOParUnordered

  39. final def mapMPartitioned[R1 <: R, E1 >: E, A2, K](keyBy: (A) ⇒ K, buffer: ⇒ Int = 16)(f: (A) ⇒ ZIO[R1, E1, A2])(implicit trace: ZTraceElement): ZStream[R1, E1, A2]

    Permalink

    Maps over elements of the stream with the specified effectful function, partitioned by p executing invocations of f concurrently.

    Maps over elements of the stream with the specified effectful function, partitioned by p executing invocations of f concurrently. The number of concurrent invocations of f is determined by the number of different outputs of type K. Up to buffer elements may be buffered per partition. Transformed elements may be reordered but the order within a partition is maintained.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIOPartitioned

  40. final def runFoldM[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldZIO

  41. final def runFoldManagedM[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldManagedZIO

  42. final def runFoldWhileM[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZIO[R1, E1, S]

    Permalink

    Executes an effectful fold over the stream of values.

    Executes an effectful fold over the stream of values. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileZIO

  43. final def runFoldWhileManagedM[R1 <: R, E1 >: E, S](s: ⇒ S)(cont: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZManaged[R1, E1, S]

    Permalink

    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. Stops the fold early when the condition is not fulfilled. Example:

    Stream(1)
      .forever                                // an infinite Stream of 1's
      .fold(0)(_ <= 4)((s, a) => UIO(s + a))  // Managed[Nothing, Int]
      .use(ZIO.succeed)                       // UIO[Int] == 5
    cont

    function which defines the early termination condition

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runFoldWhileManagedZIO

  44. final def runInto[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZIO[R1, E1, Unit]

    Permalink

    Enqueues elements of this stream into a queue.

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueue

  45. final def runIntoElementsManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Exit[Option[E1], A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueueElementsManaged

  46. final def runIntoManaged[R1 <: R, E1 >: E](queue: ⇒ ZQueue[R1, Nothing, Nothing, Any, Take[E1, A], Any])(implicit trace: ZTraceElement): ZManaged[R1, E1, Unit]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runIntoQueueManaged

  47. def scanM[R1 <: R, E1 >: E, S](s: ⇒ S)(f: (S, A) ⇒ ZIO[R1, E1, S])(implicit trace: ZTraceElement): ZStream[R1, E1, S]

    Permalink

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results of type S given an initial S.

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results of type S given an initial S.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use scanZIO

  48. def scanReduceM[R1 <: R, E1 >: E, A1 >: A](f: (A1, A) ⇒ ZIO[R1, E1, A1])(implicit trace: ZTraceElement): ZStream[R1, E1, A1]

    Permalink

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results.

    Statefully and effectfully maps over the elements of this stream to produce all intermediate results.

    See also ZStream#scanM.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use scanReduceZIO

  49. def takeUntilM[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Takes all elements of the stream until the specified effectual predicate evaluates to true.

    Takes all elements of the stream until the specified effectual predicate evaluates to true.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use takeUntilZIO

  50. final def throttleEnforceM[R1 <: R, E1 >: E](units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ ZIO[R1, E1, Long])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, A]

    Permalink

    Throttles the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Throttles the chunks of this stream 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. Chunks that do not meet the bandwidth constraints are dropped. The weight of each chunk is determined by the costFn effectful function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use throttleEnforceZIO

  51. final def throttleShapeM[R1 <: R, E1 >: E](units: ⇒ Long, duration: ⇒ zio.Duration, burst: ⇒ Long = 0)(costFn: (Chunk[A]) ⇒ ZIO[R1, E1, Long])(implicit trace: ZTraceElement): ZStream[R1 with Clock, E1, A]

    Permalink

    Delays the chunks of this stream according to the given bandwidth parameters using the token bucket algorithm.

    Delays the chunks of this stream 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 chunk is determined by the costFn effectful function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use throttleShapeZIO

  52. final def timeoutError[E1 >: E](e: ⇒ E1)(d: zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E1, A]

    Permalink

    Fails the stream with given error if it does not produce a value after d duration.

    Fails the stream with given error if it does not produce a value after d duration.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use timeoutFail

  53. final def timeoutErrorCause[E1 >: E](cause: ⇒ Cause[E1])(d: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E1, A]

    Permalink

    Fails the stream with given cause if it does not produce a value after d duration.

    Fails the stream with given cause if it does not produce a value after d duration.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use timeoutFailCause

  54. final def timeoutHalt[E1 >: E](cause: ⇒ Cause[E1])(d: ⇒ zio.Duration)(implicit trace: ZTraceElement): ZStream[R with Clock, E1, A]

    Permalink

    Halts the stream with given cause if it does not produce a value after d duration.

    Halts the stream with given cause if it does not produce a value after d duration.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use timeoutFailCause

  55. def whenM[R1 <: R, E1 >: E](b: ⇒ ZIO[R1, E1, Boolean])(implicit trace: ZTraceElement): ZStream[R1, E1, A]

    Permalink

    Returns this stream if the specified effectful condition is satisfied, otherwise returns an empty stream.

    Returns this stream if the specified effectful condition is satisfied, otherwise returns an empty stream.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use whenZIO

Inherited from AnyRef

Inherited from Any

Ungrouped