ZManagedZStreamSyntax

zio.managed.`package`.ZManagedZStreamSyntax
final implicit class ZManagedZStreamSyntax[R, E, A](self: ZStream[R, E, A]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

final def runFoldManaged[S](s: => S)(f: (S, A) => S)(implicit trace: Trace): ZManaged[R, E, S]

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

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

Attributes

final def runFoldManagedZIO[R1 <: R, E1 >: E, S](s: => S)(f: (S, A) => ZIO[R1, E1, S])(implicit trace: Trace): ZManaged[R1, E1, S]

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

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

Attributes

final def runFoldWhileManaged[S](s: => S)(cont: S => Boolean)(f: (S, A) => S)(implicit trace: Trace): ZManaged[R, E, S]

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.

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.

Attributes

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

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:

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)
   .fold(0)(_ <= 4)((s, a) => ZIO.succeed(s + a))  // Managed[Nothing, Int]
   .use(ZIO.succeed)                               // UIO[Int] == 5

Value parameters

cont

function which defines the early termination condition

Attributes

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

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

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

Attributes

final def runForeachScoped[R1 <: R, E1 >: E](f: A => ZIO[R1, E1, Any])(implicit trace: Trace): ZManaged[R1, E1, Unit]

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.

Attributes

final def runForeachWhileManaged[R1 <: R, E1 >: E](f: A => ZIO[R1, E1, Boolean])(implicit trace: Trace): ZManaged[R1, E1, Unit]

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

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

Attributes

final def runIntoHubManaged[E1 >: E, A1 >: A](hub: => Hub[Take[E1, A1]])(implicit trace: Trace): ZManaged[R, E1, Unit]

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

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

Attributes

final def runIntoQueueElementsManaged(queue: => Enqueue[Exit[Option[E], A]])(implicit trace: Trace): ZManaged[R, E, Unit]

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

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

Attributes

final def runIntoQueueManaged(queue: => Enqueue[Take[E, A]])(implicit trace: Trace): ZManaged[R, E, Unit]

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

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

Attributes

def runManaged[R1 <: R, E1 >: E, B](sink: => ZSink[R1, E1, A, Any, B])(implicit trace: Trace): ZManaged[R1, E1, B]