Trait/Object

zio

ZIO

Related Docs: object ZIO | package zio

Permalink

sealed trait ZIO[-R, +E, +A] extends Serializable

A ZIO[R, E, A] ("Zee-Oh of Are Eeh Aye") is an immutable data structure that models an effectful program. The effect requires an environment R, and the effect may fail with an error E or produce a single A.

Conceptually, this structure is equivalent to ReaderT[R, EitherT[UIO, E, ?]] for some infallible effect monad UIO, but because monad transformers perform poorly in Scala, this data structure bakes in the reader effect of ReaderT with the recoverable error effect of EitherT without runtime overhead.

ZIO values are ordinary immutable values, and may be used like any other value in purely functional code. Because ZIO values just *model* effects (like input / output), which must be interpreted by a separate runtime system, ZIO values are entirely pure and do not violate referential transparency.

ZIO values can efficiently describe the following classes of effects:

The concurrency model is based on fibers, a user-land lightweight thread, which permit cooperative multitasking, fine-grained interruption, and very high performance with large numbers of concurrently executing fibers.

ZIO values compose with other ZIO values in a variety of ways to build complex, rich, interactive applications. See the methods on ZIO for more details about how to compose ZIO values.

In order to integrate with Scala, ZIO values must be interpreted into the Scala runtime. This process of interpretation executes the effects described by a given immutable ZIO value. For more information on interpreting ZIO values, see the default interpreter in DefaultRuntime or the safe main function in App.

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

Abstract Value Members

  1. abstract def tag: Int

    Permalink

    An integer that identifies the term in the ZIO sum type to which this instance belongs (e.g.

    An integer that identifies the term in the ZIO sum type to which this instance belongs (e.g. IO.Tags.Succeed).

Concrete 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, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (A, B)]

    Permalink

    Sequentially zips this effect with the specified effect, combining the results into a tuple.

  4. final def &>[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Returns an effect that executes both this effect and the specified effect, in parallel, returning result of provided effect.

    Returns an effect that executes both this effect and the specified effect, in parallel, returning result of provided effect. If either side fails, then the other side will be interrupted, interrupted the result.

  5. final def *>[R1 <: R, E1 >: E, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    A variant of flatMap that ignores the value produced by this effect.

  6. final def +++[R1, B, E1 >: E](that: ZIO[R1, E1, B]): ZIO[Either[R, R1], E1, Either[A, B]]

    Permalink
  7. final def <&[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, A]

    Permalink

    Returns an effect that executes both this effect and the specified effect, in parallel, this effect result returned.

    Returns an effect that executes both this effect and the specified effect, in parallel, this effect result returned. If either side fails, then the other side will be interrupted, interrupted the result.

  8. final def <&>[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (A, B)]

    Permalink

    Returns an effect that executes both this effect and the specified effect, in parallel, combining their results into a tuple.

    Returns an effect that executes both this effect and the specified effect, in parallel, combining their results into a tuple. If either side fails, then the other side will be interrupted, interrupted the result.

  9. final def <*[R1 <: R, E1 >: E, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, A]

    Permalink

    Sequences the specified effect after this effect, but ignores the value produced by the effect.

  10. final def <*>[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (A, B)]

    Permalink

    Alias for &&&.

  11. final def <<<[R1, E1 >: E](that: ZIO[R1, E1, R]): ZIO[R1, E1, A]

    Permalink
  12. final def <>[R1 <: R, E2, A1 >: A](that: ⇒ ZIO[R1, E2, A1])(implicit ev: CanFail[E]): ZIO[R1, E2, A1]

    Permalink

    Operator alias for orElse.

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def >>=[R1 <: R, E1 >: E, B](k: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Alias for flatMap.

    Alias for flatMap.

    val parsed = readFile("foo.txt") >>= parseFile
  15. final def >>>[R1 >: A, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R, E1, B]

    Permalink
  16. final def absolve[R1 <: R, E1, B](implicit ev1: <:<[ZIO[R, E, A], ZIO[R1, E1, Either[E1, B]]]): ZIO[R1, E1, B]

    Permalink

    Returns an effect that submerges the error case of an Either into the ZIO.

    Returns an effect that submerges the error case of an Either into the ZIO. The inverse operation of ZIO.either.

  17. final def absorb(implicit ev: <:<[E, Throwable]): ZIO[R, Throwable, A]

    Permalink

    Attempts to convert defects into a failure, throwing away all information about the cause of the failure.

  18. final def absorbWith(f: (E) ⇒ Throwable): ZIO[R, Throwable, A]

    Permalink

    Attempts to convert defects into a failure, throwing away all information about the cause of the failure.

  19. final def andThen[R1 >: A, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R, E1, B]

    Permalink
  20. final def as[B](b: ⇒ B): ZIO[R, E, B]

    Permalink

    Maps the success value of this effect to the specified constant value.

  21. final def asError[E1](e1: ⇒ E1)(implicit ev: CanFail[E]): ZIO[R, E1, A]

    Permalink

    Maps the error value of this effect to the specified constant value.

  22. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  23. final def bimap[E2, B](f: (E) ⇒ E2, g: (A) ⇒ B)(implicit ev: CanFail[E]): ZIO[R, E2, B]

    Permalink

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

  24. final def bracket[R1 <: R, E1 >: E]: BracketAcquire[R1, E1, A]

    Permalink

    Shorthand for the curried version of ZIO.bracket.

  25. final def bracket[R1 <: R, E1 >: E, B](release: (A) ⇒ URIO[R1, Any], use: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Shorthand for the uncurried version of ZIO.bracket.

  26. final def bracketExit[R1 <: R, E1 >: E, A1 >: A]: BracketExitAcquire[R1, E1, A1]

    Permalink

    Shorthand for the curried version of ZIO.bracketExit.

  27. final def bracketExit[R1 <: R, E1 >: E, B](release: (A, Exit[E1, B]) ⇒ URIO[R1, Any], use: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Shorthand for the uncurried version of ZIO.bracketExit.

  28. final def bracketOnError[R1 <: R, E1 >: E, B](release: (A) ⇒ URIO[R1, Any])(use: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Executes the release effect only if there was an error.

  29. final def bracket_[R1 <: R, E1 >: E, B](release: URIO[R1, Any], use: ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Uncurried version.

    Uncurried version. Doesn't offer curried syntax and has worse type-inference characteristics, but it doesn't allocate intermediate zio.ZIO.BracketAcquire_ and zio.ZIO.BracketRelease_ objects.

  30. final def bracket_[R1 <: R, E1 >: E]: BracketAcquire_[R1, E1]

    Permalink

    A less powerful variant of bracket where the resource acquired by this effect is not needed.

  31. final def cached(timeToLive: Duration): ZIO[R with Clock, Nothing, IO[E, A]]

    Permalink

    Returns an effect that, if evaluated, will return the cached result of this effect.

    Returns an effect that, if evaluated, will return the cached result of this effect. Cached results will expire after timeToLive duration.

  32. final def catchAll[R1 <: R, E2, A1 >: A](h: (E) ⇒ ZIO[R1, E2, A1])(implicit ev: CanFail[E]): ZIO[R1, E2, A1]

    Permalink

    Recovers from all errors.

    Recovers from all errors.

    openFile("config.json").catchAll(_ => IO.succeed(defaultConfig))
  33. final def catchAllCause[R1 <: R, E2, A1 >: A](h: (Cause[E]) ⇒ ZIO[R1, E2, A1]): ZIO[R1, E2, A1]

    Permalink

    Recovers from all errors with provided Cause.

    Recovers from all errors with provided Cause.

    openFile("config.json").catchAllCause(_ => IO.succeed(defaultConfig))
    See also

    absorb, sandbox, mapErrorCause - other functions that can recover from defects

  34. final def catchSome[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[E, ZIO[R1, E1, A1]])(implicit ev: CanFail[E]): ZIO[R1, E1, A1]

    Permalink

    Recovers from some or all of the error cases.

    Recovers from some or all of the error cases.

    openFile("data.json").catchSome {
      case FileNotFoundException(_) => openFile("backup.json")
    }
  35. final def catchSomeCause[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[Cause[E], ZIO[R1, E1, A1]]): ZIO[R1, E1, A1]

    Permalink

    Recovers from some or all of the error cases with provided cause.

    Recovers from some or all of the error cases with provided cause.

    openFile("data.json").catchSomeCause {
      case c if (c.interrupted) => openFile("backup.json")
    }
  36. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def collect[E1 >: E, B](e: E1)(pf: PartialFunction[A, B]): ZIO[R, E1, B]

    Permalink

    Fail with e if the supplied PartialFunction does not match, otherwise succeed with the returned value.

  38. final def collectM[R1 <: R, E1 >: E, B](e: E1)(pf: PartialFunction[A, ZIO[R1, E1, B]]): ZIO[R1, E1, B]

    Permalink

    Fail with e if the supplied PartialFunction does not match, otherwise continue with the returned value.

  39. final def compose[R1, E1 >: E](that: ZIO[R1, E1, R]): ZIO[R1, E1, A]

    Permalink
  40. final def daemon: ZIO[R, E, A]

    Permalink

    Turns on daemon mode for this region, which means that any fibers forked in this region will be daemon fibers—new roots in the fiber graph and invisible to the their (otherwise) parent fiber, and not interrupted when their (otherwise) parent fiber is interrupted.

  41. final def daemonStatus(status: DaemonStatus): ZIO[R, E, A]

    Permalink

    Changes the daemon mode status for this region, either turning it off (the default), or turning it on.

  42. final def delay(duration: Duration): ZIO[R with Clock, E, A]

    Permalink

    Returns an effect that is delayed from this effect by the specified zio.duration.Duration.

  43. final def doUntil(f: (A) ⇒ Boolean): ZIO[R, E, A]

    Permalink

    Repeats this effect until its result satisfies the specified predicate.

  44. final def doWhile(f: (A) ⇒ Boolean): ZIO[R, E, A]

    Permalink

    Repeats this effect while its result satisfies the specified predicate.

  45. final def either(implicit ev: CanFail[E]): URIO[R, Either[E, A]]

    Permalink

    Returns an effect whose failure and success have been lifted into an Either.The resulting effect cannot fail, because the failure case has been exposed as part of the Either success case.

    Returns an effect whose failure and success have been lifted into an Either.The resulting effect cannot fail, because the failure case has been exposed as part of the Either success case.

    This method is useful for recovering from ZIO effects that may fail.

    The error parameter of the returned ZIO is Nothing, since it is guaranteed the ZIO effect does not model failure.

  46. final def ensuring[R1 <: R](finalizer: URIO[R1, Any]): ZIO[R1, E, A]

    Permalink

    Returns an effect that, if this effect _starts_ execution, then the specified finalizer is guaranteed to begin execution, whether this effect succeeds, fails, or is interrupted.

    Returns an effect that, if this effect _starts_ execution, then the specified finalizer is guaranteed to begin execution, whether this effect succeeds, fails, or is interrupted.

    Finalizers offer very powerful guarantees, but they are low-level, and should generally not be used for releasing resources. For higher-level logic built on ensuring, see ZIO#bracket.

  47. final def ensuringChild[R1 <: R](f: (Fiber[Any, List[Any]]) ⇒ ZIO[R1, Nothing, Any]): ZIO[R1, E, A]

    Permalink

    Acts on the children of this fiber (collected into a single fiber), guaranteeing the specified callback will be invoked, whether or not this effect succeeds.

  48. final def ensuringChildren[R1 <: R](f: (Iterable[Fiber[Any, Any]]) ⇒ ZIO[R1, Nothing, Any]): ZIO[R1, E, A]

    Permalink

    Acts on the children of this fiber, guaranteeing the specified callback will be invoked, whether or not this effect succeeds.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  51. final def eventually(implicit ev: CanFail[E]): URIO[R, A]

    Permalink

    Returns an effect that ignores errors and runs repeatedly until it eventually succeeds.

  52. final def filterOrDie(p: (A) ⇒ Boolean)(t: ⇒ Throwable): ZIO[R, E, A]

    Permalink

    Dies with specified Throwable if the predicate fails.

  53. final def filterOrDieMessage(p: (A) ⇒ Boolean)(message: ⇒ String): ZIO[R, E, A]

    Permalink

    Dies with a java.lang.RuntimeException having the specified text message if the predicate fails.

  54. final def filterOrElse[R1 <: R, E1 >: E, A1 >: A](p: (A) ⇒ Boolean)(f: (A) ⇒ ZIO[R1, E1, A1]): ZIO[R1, E1, A1]

    Permalink

    Applies f if the predicate fails.

  55. final def filterOrElse_[R1 <: R, E1 >: E, A1 >: A](p: (A) ⇒ Boolean)(zio: ⇒ ZIO[R1, E1, A1]): ZIO[R1, E1, A1]

    Permalink

    Supplies zio if the predicate fails.

  56. final def filterOrFail[E1 >: E](p: (A) ⇒ Boolean)(e: ⇒ E1): ZIO[R, E1, A]

    Permalink

    Fails with e if the predicate fails.

  57. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  58. def firstSuccessOf[R1 <: R, E1 >: E, A1 >: A](rest: Iterable[ZIO[R1, E1, A1]]): ZIO[R1, E1, A1]

    Permalink

    Returns an effect that races this effect with all the specified effects, yielding the value of the first effect to succeed with a value.

    Returns an effect that races this effect with all the specified effects, yielding the value of the first effect to succeed with a value. Losers of the race will be interrupted immediately

  59. def flatMap[R1 <: R, E1 >: E, B](k: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Returns an effect that models the execution of this effect, followed by the passing of its value to the specified continuation function k, followed by the effect that it returns.

    Returns an effect that models the execution of this effect, followed by the passing of its value to the specified continuation function k, followed by the effect that it returns.

    val parsed = readFile("foo.txt").flatMap(file => parseFile(file))
  60. final def flatMapError[R1 <: R, E2](f: (E) ⇒ URIO[R1, E2])(implicit ev: CanFail[E]): ZIO[R1, E2, A]

    Permalink

    Creates a composite effect that represents this effect followed by another one that may depend on the error produced by this one.

    Creates a composite effect that represents this effect followed by another one that may depend on the error produced by this one.

    val parsed = readFile("foo.txt").flatMapError(error => logErrorToFile(error))
  61. final def flatten[R1 <: R, E1 >: E, B](implicit ev1: <:<[A, ZIO[R1, E1, B]]): ZIO[R1, E1, B]

    Permalink

    Returns an effect that performs the outer effect first, followed by the inner effect, yielding the value of the inner effect.

    Returns an effect that performs the outer effect first, followed by the inner effect, yielding the value of the inner effect.

    This method can be used to "flatten" nested effects.

  62. final def flattenErrorOption[E1, E2 <: E1](default: E2)(implicit ev: <:<[E, Option[E1]]): ZIO[R, E1, A]

    Permalink
  63. final def flip: ZIO[R, A, E]

    Permalink

    Returns an effect that swaps the error/success cases.

    Returns an effect that swaps the error/success cases. This allows you to use all methods on the error channel, possibly before flipping back.

  64. final def flipWith[R1, A1, E1](f: (ZIO[R, A, E]) ⇒ ZIO[R1, A1, E1]): ZIO[R1, E1, A1]

    Permalink

    Swaps the error/value parameters, applies the function f and flips the parameters back

  65. final def fold[B](failure: (E) ⇒ B, success: (A) ⇒ B)(implicit ev: CanFail[E]): URIO[R, B]

    Permalink

    Folds over the failure value or the success value to yield an effect that does not fail, but succeeds with the value returned by the left or right function passed to fold.

  66. final def foldCause[B](failure: (Cause[E]) ⇒ B, success: (A) ⇒ B): URIO[R, B]

    Permalink

    A more powerful version of fold that allows recovering from any kind of failure except interruptions.

  67. def foldCauseM[R1 <: R, E2, B](failure: (Cause[E]) ⇒ ZIO[R1, E2, B], success: (A) ⇒ ZIO[R1, E2, B]): ZIO[R1, E2, B]

    Permalink

    A more powerful version of foldM that allows recovering from any kind of failure except interruptions.

  68. final def foldM[R1 <: R, E2, B](failure: (E) ⇒ ZIO[R1, E2, B], success: (A) ⇒ ZIO[R1, E2, B])(implicit ev: CanFail[E]): ZIO[R1, E2, B]

    Permalink

    Recovers from errors by accepting one effect to execute for the case of an error, and one effect to execute for the case of success.

    Recovers from errors by accepting one effect to execute for the case of an error, and one effect to execute for the case of success.

    This method has better performance than either since no intermediate value is allocated and does not require subsequent calls to flatMap to define the next effect.

    The error parameter of the returned IO may be chosen arbitrarily, since it will depend on the IOs returned by the given continuations.

  69. final def forever: ZIO[R, E, Nothing]

    Permalink

    Repeats this effect forever (until the first error).

    Repeats this effect forever (until the first error). For more sophisticated schedules, see the repeat method.

  70. final def fork: URIO[R, Fiber[E, A]]

    Permalink

    Returns an effect that forks this effect into its own separate fiber, returning the fiber immediately, without waiting for it to compute its value.

    Returns an effect that forks this effect into its own separate fiber, returning the fiber immediately, without waiting for it to compute its value.

    The returned fiber can be used to interrupt the forked fiber, await its result, or join the fiber. See zio.Fiber for more information.

    for {
      fiber <- subtask.fork
      // Do stuff...
      a <- fiber.join
    } yield a
  71. final def forkAs(name: String): URIO[R, Fiber[E, A]]

    Permalink

    Forks the effect into a new independent fiber, with the specified name.

  72. final def forkOn(ec: ExecutionContext): ZIO[R, E, Fiber[E, A]]

    Permalink

    Forks an effect that will be executed on the specified ExecutionContext.

  73. final def get[E1 >: E, B](implicit ev1: =:=[E1, Nothing], ev2: <:<[A, Option[B]]): ZIO[R, Unit, B]

    Permalink

    Unwraps the optional success of this effect, but can fail with unit value.

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

    Permalink
    Definition Classes
    AnyRef → Any
  75. final def handleChildrenWith[R1 <: R, E1 >: E](f: (Iterable[Fiber[Any, Any]]) ⇒ URIO[R1, Any]): ZIO[R1, E1, A]

    Permalink

    Returns a new effect that, on exit of this effect, invokes the specified handler with all forked (non-daemon) children of this effect.

  76. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  77. def head[B](implicit ev: <:<[A, List[B]]): ZIO[R, Option[E], B]

    Permalink

    Returns a successful effect with the head of the list if the list is non-empty or fails with the error None if the list is empty.

  78. final def ignore: URIO[R, Unit]

    Permalink

    Returns a new effect that ignores the success or failure of this effect.

  79. final def interruptStatus(flag: InterruptStatus): ZIO[R, E, A]

    Permalink

    Switches the interrupt status for this effect.

    Switches the interrupt status for this effect. If true is used, then the effect becomes interruptible (the default), while if false is used, then the effect becomes uninterruptible. These changes are compositional, so they only affect regions of the effect.

  80. final def interruptible: ZIO[R, E, A]

    Permalink

    Performs this effect interruptibly.

    Performs this effect interruptibly. Because this is the default, this operation only has additional meaning if the effect is located within an uninterruptible section.

  81. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  82. final def join[R1, E1 >: E, A1 >: A](that: ZIO[R1, E1, A1]): ZIO[Either[R, R1], E1, A1]

    Permalink

    Joins this effect with the specified effect.

  83. def left[B, C](implicit ev: <:<[A, Either[B, C]]): ZIO[R, Option[E], B]

    Permalink

    Returns a successful effect if the value is Left, or fails with the error None.

  84. def leftOrFail[B, C, E1 >: E](e: E1)(implicit ev: <:<[A, Either[B, C]]): ZIO[R, E1, B]

    Permalink

    Returns a successful effect if the value is Left, or fails with the error e.

  85. def leftOrFailException[B, C, E1 >: NoSuchElementException](implicit ev: <:<[A, Either[B, C]], ev2: <:<[E, E1]): ZIO[R, E1, B]

    Permalink

    Returns a successful effect if the value is Left, or fails with a java.util.NoSuchElementException.

  86. final def lock(executor: Executor): ZIO[R, E, A]

    Permalink

    Returns an effect which is guaranteed to be executed on the specified executor.

    Returns an effect which is guaranteed to be executed on the specified executor. The specified effect will always run on the specified executor, even in the presence of asynchronous boundaries.

    This is useful when an effect must be executued somewhere, for example: on a UI thread, inside a client library's thread pool, inside a blocking thread pool, inside a low-latency thread pool, or elsewhere.

    The lock function composes with the innermost lock taking priority. Use of this method does not alter the execution semantics of other effects composed with this one, making it easy to compositionally reason about where effects are running.

  87. def map[B](f: (A) ⇒ B): ZIO[R, E, B]

    Permalink

    Returns an effect whose success is mapped by the specified f function.

  88. final def mapError[E2](f: (E) ⇒ E2)(implicit ev: CanFail[E]): ZIO[R, E2, A]

    Permalink

    Returns an effect with its error channel mapped using the specified function.

    Returns an effect with its error channel mapped using the specified function. This can be used to lift a "smaller" error into a "larger" error.

  89. final def mapErrorCause[E2](h: (Cause[E]) ⇒ Cause[E2]): ZIO[R, E2, A]

    Permalink

    Returns an effect with its full cause of failure mapped using the specified function.

    Returns an effect with its full cause of failure mapped using the specified function. This can be used to transform errors while preserving the original structure of Cause.

    See also

    absorb, sandbox, catchAllCause - other functions for dealing with defects

  90. final def memoize: URIO[R, IO[E, A]]

    Permalink

    Returns an effect that, if evaluated, will return the lazily computed result of this effect.

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

    Permalink
    Definition Classes
    AnyRef
  92. final def nonDaemon: ZIO[R, E, A]

    Permalink

    Turns off daemon mode for this region, which means that any fibers forked in this region will not be daemon fibers, so they will be visible as children of their parent fiber, and interrupted when their parent fiber is interrupted.

  93. final def none[B](implicit ev: <:<[A, Option[B]]): ZIO[R, Option[E], Unit]

    Permalink

    Requires the option produced by this value to be None.

  94. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  96. final def on(ec: ExecutionContext): ZIO[R, E, A]

    Permalink

    Executes the effect on the specified ExecutionContext and then shifts back to the default one.

  97. final def onError[R1 <: R](cleanup: (Cause[E]) ⇒ URIO[R1, Any]): ZIO[R1, E, A]

    Permalink

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

    Runs the specified effect if this effect fails, providing the error to the effect if it exists. The provided effect will not be interrupted.

  98. final def onFirst[R1 <: R, A1 >: A]: ZIO[R1, E, (A1, R1)]

    Permalink

    Propagates the success value to the first element of a tuple, but passes the effect input R along unmodified as the second element of the tuple.

  99. final def onInterrupt[R1 <: R](cleanup: URIO[R1, Any]): ZIO[R1, E, A]

    Permalink

    Runs the specified effect if this effect is externally interrupted.

  100. final def onLeft[R1 <: R, C]: ZIO[Either[R1, C], E, Either[A, C]]

    Permalink
  101. final def onRight[R1 <: R, C]: ZIO[Either[C, R1], E, Either[C, A]]

    Permalink
  102. final def onSecond[R1 <: R, A1 >: A]: ZIO[R1, E, (R1, A1)]

    Permalink

    Propagates the success value to the second element of a tuple, but passes the effect input R along unmodified as the first element of the tuple.

  103. final def onTermination[R1 <: R](cleanup: (Cause[Nothing]) ⇒ URIO[R1, Any]): ZIO[R1, E, A]

    Permalink

    Runs the specified effect if this effect is terminated, either because of a defect or because of interruption.

  104. final def option(implicit ev: CanFail[E]): URIO[R, Option[A]]

    Permalink

    Executes this effect, skipping the error but returning optionally the success.

  105. final def optional[E1](implicit ev: <:<[E, Option[E1]]): ZIO[R, E1, Option[A]]

    Permalink

    Converts an option on errors into an option on values.

  106. final def orDie[E1 >: E](implicit ev1: <:<[E1, Throwable], ev2: CanFail[E]): URIO[R, A]

    Permalink

    Translates effect failure into death of the fiber, making all failures unchecked and not a part of the type of the effect.

  107. final def orDieWith(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): URIO[R, A]

    Permalink

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

  108. final def orElse[R1 <: R, E2, A1 >: A](that: ⇒ ZIO[R1, E2, A1])(implicit ev: CanFail[E]): ZIO[R1, E2, A1]

    Permalink

    Executes this effect and returns its value, if it succeeds, but otherwise executes the specified effect.

  109. final def orElseEither[R1 <: R, E2, B](that: ⇒ ZIO[R1, E2, B])(implicit ev: CanFail[E]): ZIO[R1, E2, Either[A, B]]

    Permalink

    Returns an effect that will produce the value of this effect, unless it fails, in which case, it will produce the value of the specified effect.

  110. final def parallelErrors[E1 >: E]: ZIO[R, ::[E1], A]

    Permalink

    Exposes all parallel errors in a single call

  111. final def provide(r: R)(implicit ev: NeedsEnv[R]): IO[E, A]

    Permalink

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

  112. final def provideM[E1 >: E](r: ZIO[Any, E1, R])(implicit ev: NeedsEnv[R]): ZIO[Any, E1, A]

    Permalink

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

  113. final def provideManaged[E1 >: E](r0: Managed[E1, R])(implicit ev: NeedsEnv[R]): IO[E1, A]

    Permalink

    Uses the given Managed[E1, R] to the environment required to run this effect, leaving no outstanding environments and returning IO[E1, A]

  114. final def provideSome[R0](f: (R0) ⇒ R)(implicit ev: NeedsEnv[R]): ZIO[R0, E, A]

    Permalink

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

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

    val effect: ZIO[Console with Logging, Nothing, Unit] = ???
    
    effect.provideSome[Console](env =>
      new Console with Logging {
        val console = env.console
        val logging = new Logging.Service[Any] {
          def log(line: String) = console.putStrLn(line)
        }
      }
    )
  115. final def provideSomeM[R0, E1 >: E](r0: ZIO[R0, E1, R])(implicit ev: NeedsEnv[R]): ZIO[R0, E1, A]

    Permalink

    An effectful version of provideSome, useful when the act of partial provision requires an effect.

    An effectful version of provideSome, useful when the act of partial provision requires an effect.

    val effect: ZIO[Console with Logging, Nothing, Unit] = ???
    
    val r0: URIO[Console, Console with Logging] = ???
    
    effect.provideSomeM(r0)
  116. final def provideSomeManaged[R0, E1 >: E](r0: ZManaged[R0, E1, R])(implicit ev: NeedsEnv[R]): ZIO[R0, E1, A]

    Permalink

    Uses the given ZManaged[R0, E1, R] to provide some of the environment required to run this effect, leaving the remainder R0.

  117. final def race[R1 <: R, E1 >: E, A1 >: A](that: ZIO[R1, E1, A1]): ZIO[R1, E1, A1]

    Permalink

    Returns an effect that races this effect with the specified effect, returning the first successful A from the faster side.

    Returns an effect that races this effect with the specified effect, returning the first successful A from the faster side. If one effect succeeds, the other will be interrupted. If neither succeeds, then the effect will fail with some error.

  118. def raceAll[R1 <: R, E1 >: E, A1 >: A](ios: Iterable[ZIO[R1, E1, A1]]): ZIO[R1, E1, A1]

    Permalink

    Returns an effect that races this effect with all the specified effects, yielding the value of the first effect to succeed with a value.

    Returns an effect that races this effect with all the specified effects, yielding the value of the first effect to succeed with a value. Losers of the race will be interrupted immediately

  119. final def raceAttempt[R1 <: R, E1 >: E, A1 >: A](that: ZIO[R1, E1, A1]): ZIO[R1, E1, A1]

    Permalink

    Returns an effect that races this effect with the specified effect, yielding the first result to complete, whether by success or failure.

    Returns an effect that races this effect with the specified effect, yielding the first result to complete, whether by success or failure. If neither effect completes, then the composed effect will not complete.

  120. final def raceEither[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, Either[A, B]]

    Permalink

    Returns an effect that races this effect with the specified effect, yielding the first result to succeed.

    Returns an effect that races this effect with the specified effect, yielding the first result to succeed. If neither effect succeeds, then the composed effect will fail with some error.

  121. final def raceWith[R1 <: R, E1, E2, B, C](that: ZIO[R1, E1, B])(leftDone: (Exit[E, A], Fiber[E1, B]) ⇒ ZIO[R1, E2, C], rightDone: (Exit[E1, B], Fiber[E, A]) ⇒ ZIO[R1, E2, C]): ZIO[R1, E2, C]

    Permalink

    Returns an effect that races this effect with the specified effect, calling the specified finisher as soon as one result or the other has been computed.

  122. final def refailWithTrace: ZIO[R, E, A]

    Permalink

    Attach a wrapping trace pointing to this location in case of error.

    Attach a wrapping trace pointing to this location in case of error.

    Useful when joining fibers to make the resulting trace mention the join point, otherwise only the traces of joined fibers are included.

    for {
      badFiber <- UIO(1 / 0).fork
      _ <- badFiber.join.refailWithTrace
    } yield ()
  123. final def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: <:<[E, Throwable], ev2: CanFail[E]): ZIO[R, E1, A]

    Permalink

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

  124. final def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): ZIO[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.

  125. final def refineToOrDie[E1](implicit arg0: ClassTag[E1], ev1: <:<[E, Throwable], ev2: CanFail[E]): ZIO[R, E1, A]

    Permalink

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

  126. final def reject[R1 <: R, E1 >: E](pf: PartialFunction[A, E1]): ZIO[R1, E1, A]

    Permalink

    Fail with the returned value if the PartialFunction matches, otherwise continue with our held value.

  127. final def rejectM[R1 <: R, E1 >: E](pf: PartialFunction[A, ZIO[R1, E1, E1]]): ZIO[R1, E1, A]

    Permalink

    Continue with the returned computation if the PartialFunction matches, translating the successful match into a failure, otherwise continue with our held value.

  128. final def repeat[R1 <: R, B](schedule: Schedule[R1, A, B]): ZIO[R1, E, B]

    Permalink

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure.

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure. Repeats are done in addition to the first execution so that io.repeat(Schedule.once) means "execute io and in case of success repeat io once".

  129. final def repeatOrElse[R1 <: R, E2, B](schedule: Schedule[R1, A, B], orElse: (E, Option[B]) ⇒ ZIO[R1, E2, B]): ZIO[R1, E2, B]

    Permalink

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure.

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure. In the event of failure the progress to date, together with the error, will be passed to the specified handler.

  130. final def repeatOrElseEither[R1 <: R, B, E2, C](schedule: Schedule[R1, A, B], orElse: (E, Option[B]) ⇒ ZIO[R1, E2, C]): ZIO[R1, E2, Either[C, B]]

    Permalink

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure.

    Repeats this effect with the specified schedule until the schedule completes, or until the first failure. In the event of failure the progress to date, together with the error, will be passed to the specified handler.

  131. final def retry[R1 <: R, E1 >: E, S](policy: Schedule[R1, E1, S])(implicit ev: CanFail[E]): ZIO[R1, E, A]

    Permalink

    Retries with the specified retry policy.

    Retries with the specified retry policy. Retries are done following the failure of the original io (up to a fixed maximum with once or recurs for example), so that that io.retry(Schedule.once) means "execute io and in case of failure, try again once".

  132. final def retryOrElse[R1 <: R, A2 >: A, E1 >: E, S, E2](policy: Schedule[R1, E1, S], orElse: (E, S) ⇒ ZIO[R1, E2, A2])(implicit ev: CanFail[E]): ZIO[R1, E2, A2]

    Permalink

    Retries with the specified schedule, until it fails, and then both the value produced by the schedule together with the last error are passed to the recovery function.

  133. final def retryOrElseEither[R1 <: R, E1 >: E, S, E2, B](policy: Schedule[R1, E1, S], orElse: (E, S) ⇒ ZIO[R1, E2, B])(implicit ev: CanFail[E]): ZIO[R1, E2, Either[B, A]]

    Permalink

    Retries with the specified schedule, until it fails, and then both the value produced by the schedule together with the last error are passed to the recovery function.

  134. def right[B, C](implicit ev: <:<[A, Either[B, C]]): ZIO[R, Option[E], C]

    Permalink

    Returns a succesful effect if the value is Right, or fails with the error None.

  135. def rightOrFail[B, C, E1 >: E](e: E1)(implicit ev: <:<[A, Either[B, C]]): ZIO[R, E1, C]

    Permalink

    Returns a successful effect if the value is Right, or fails with the given error 'e'.

  136. def rightOrFailException[B, C, E1 >: NoSuchElementException](implicit ev: <:<[A, Either[B, C]], ev2: <:<[E, E1]): ZIO[R, E1, C]

    Permalink

    Returns a successful effect if the value is Right, or fails with a java.util.NoSuchElementException.

  137. final def run: URIO[R, Exit[E, A]]

    Permalink

    Returns an effect that semantically runs the effect on a fiber, producing an zio.Exit for the completion value of the fiber.

  138. final def sandbox: ZIO[R, Cause[E], A]

    Permalink

    Exposes the full cause of failure of this effect.

    Exposes the full cause of failure of this effect.

    case class DomainError()
    
    val veryBadIO: IO[DomainError, Unit] =
      IO.effectTotal(5 / 0) *> IO.fail(DomainError())
    
    val caught: UIO[Unit] =
      veryBadIO.sandbox.catchAll {
        case Cause.Die(_: ArithmeticException) =>
          // Caught defect: divided by zero!
          IO.succeed(0)
        case Cause.Fail(e) =>
          // Caught error: DomainError!
          IO.succeed(0)
        case cause =>
          // Caught unknown defects, shouldn't recover!
          IO.halt(cause)
       *
      }
  139. final def sandboxWith[R1 <: R, E2, B](f: (ZIO[R1, Cause[E], A]) ⇒ ZIO[R1, Cause[E2], B]): ZIO[R1, E2, B]

    Permalink

    Companion helper to sandbox.

    Companion helper to sandbox. Allows recovery, and partial recovery, from errors and defects alike, as in:

    case class DomainError()
    
    val veryBadIO: IO[DomainError, Unit] =
      IO.effectTotal(5 / 0) *> IO.fail(DomainError())
    
    val caught: IO[DomainError, Unit] =
      veryBadIO.sandboxWith(_.catchSome {
        case Cause.Die(_: ArithmeticException)=>
          // Caught defect: divided by zero!
          IO.succeed(0)
      })

    Using sandboxWith with catchSome is better than using io.sandbox.catchAll with a partial match, because in the latter, if the match fails, the original defects will be lost and replaced by a MatchError

  140. final def some[B](implicit ev: <:<[A, Option[B]]): ZIO[R, Option[E], B]

    Permalink
  141. def some[A](a: A): UIO[Option[A]]

    Permalink

    Returns an effect with the optional value.

  142. def someOrFail[B, E1 >: E](e: E1)(implicit ev: <:<[A, Option[B]]): ZIO[R, E1, B]

    Permalink

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

  143. def someOrFailException[B, E1 >: E](implicit ev: <:<[A, Option[B]], ev2: <:<[NoSuchElementException, E1]): ZIO[R, E1, B]

    Permalink

    Extracts the optional value, or fails with a java.util.NoSuchElementException

  144. final def succeed[A](a: A): UIO[A]

    Permalink

    Returns an effect that models success with the specified strictly- evaluated value.

  145. final def summarized[R1 <: R, E1 >: E, B, C](f: (B, B) ⇒ C)(summary: ZIO[R1, E1, B]): ZIO[R1, E1, (C, A)]

    Permalink

    Summarizes a effect by computing some value before and after execution, and then combining the values to produce a summary, together with the result of execution.

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

    Permalink
    Definition Classes
    AnyRef
  147. final def tap[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any]): ZIO[R1, E1, A]

    Permalink

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

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

    readFile("data.json").tap(putStrLn)
  148. final def tapBoth[R1 <: R, E1 >: E](f: (E) ⇒ ZIO[R1, E1, Any], g: (A) ⇒ ZIO[R1, E1, Any])(implicit ev: CanFail[E]): ZIO[R1, E1, A]

    Permalink

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

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

    readFile("data.json").tapBoth(logError(_), logData(_))
  149. final def tapError[R1 <: R, E1 >: E](f: (E) ⇒ ZIO[R1, E1, Any])(implicit ev: CanFail[E]): ZIO[R1, E1, A]

    Permalink

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

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

    readFile("data.json").tapError(logError(_))
  150. final def timed: ZIO[R with Clock, E, (Duration, A)]

    Permalink

    Returns a new effect that executes this one and times the execution.

  151. final def timedWith[R1 <: R, E1 >: E](nanoTime: ZIO[R1, E1, Long]): ZIO[R1, E1, (Duration, A)]

    Permalink

    A more powerful variation of timed that allows specifying the clock.

  152. final def timeout(d: Duration): ZIO[R with Clock, E, Option[A]]

    Permalink

    Returns an effect that will timeout this effect, returning None if the timeout elapses before the effect has produced a value; and returning Some of the produced value otherwise.

    Returns an effect that will timeout this effect, returning None if the timeout elapses before the effect has produced a value; and returning Some of the produced value otherwise.

    If the timeout elapses without producing a value, the running effect will be safely interrupted

  153. final def timeoutFail[E1 >: E](e: E1)(d: Duration): ZIO[R with Clock, E1, A]

    Permalink

    The same as timeout, but instead of producing a None in the event of timeout, it will produce the specified error.

  154. final def timeoutFork(d: Duration): ZIO[R with Clock, E, Either[Fiber[E, A], A]]

    Permalink

    Returns an effect that will attempt to timeout this effect, but will not wait for the running effect to terminate if the timeout elapses without producing a value.

    Returns an effect that will attempt to timeout this effect, but will not wait for the running effect to terminate if the timeout elapses without producing a value. Returns Right with the produced value if the effect completes before the timeout or Left with the interrupting fiber otherwise.

  155. final def timeoutTo[R1 <: R, E1 >: E, A1 >: A, B](b: B): TimeoutTo[R1, E1, A1, B]

    Permalink

    Returns an effect that will timeout this effect, returning either the default value if the timeout elapses before the effect has produced a value; and or returning the result of applying the function f to the success value of the effect.

    Returns an effect that will timeout this effect, returning either the default value if the timeout elapses before the effect has produced a value; and or returning the result of applying the function f to the success value of the effect.

    If the timeout elapses without producing a value, the running effect will be safely interrupted

    IO.succeed(1).timeoutTo(None)(Some(_))(1.second)
  156. final def to[E1 >: E, A1 >: A](p: Promise[E1, A1]): URIO[R, Boolean]

    Permalink

    Returns an effect that keeps or breaks a promise based on the result of this effect.

    Returns an effect that keeps or breaks a promise based on the result of this effect. Synchronizes interruption, so if this effect is interrupted, the specified promise will be interrupted, too.

  157. final def toFuture(implicit ev2: <:<[E, Throwable]): URIO[R, CancelableFuture[E, A]]

    Permalink

    Converts the effect into a scala.concurrent.Future.

  158. final def toFutureWith(f: (E) ⇒ Throwable): URIO[R, CancelableFuture[E, A]]

    Permalink

    Converts the effect into a scala.concurrent.Future.

  159. final def toManaged[R1 <: R](release: (A) ⇒ URIO[R1, Any]): ZManaged[R1, E, A]

    Permalink

    Converts this ZIO to zio.Managed.

    Converts this ZIO to zio.Managed. This ZIO and the provided release action will be performed uninterruptibly.

  160. final def toManaged_: ZManaged[R, E, A]

    Permalink

    Converts this ZIO to zio.ZManaged with no release action.

    Converts this ZIO to zio.ZManaged with no release action. It will be performed interruptibly.

  161. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  162. final def traced: ZIO[R, E, A]

    Permalink

    Enables ZIO tracing for this effect.

    Enables ZIO tracing for this effect. Because this is the default, this operation only has an additional meaning if the effect is located within an untraced section, or the current fiber has been spawned by a parent inside an untraced section.

  163. final def tracingStatus(flag: TracingStatus): ZIO[R, E, A]

    Permalink

    Toggles ZIO tracing support for this effect.

    Toggles ZIO tracing support for this effect. If true is used, then the effect will accumulate traces, while if false is used, then tracing is disabled. These changes are compositional, so they only affect regions of the effect.

  164. final def uninterruptible: ZIO[R, E, A]

    Permalink

    Performs this effect uninterruptibly.

    Performs this effect uninterruptibly. This will prevent the effect from being terminated externally, but the effect may fail for internal reasons (e.g. an uncaught error) or terminate due to defect.

    Uninterruptible effects may recover from all failure causes (including interruption of an inner effect that has been made interruptible).

  165. final def unit: ZIO[R, E, Unit]

    Permalink

    Returns the effect resulting from mapping the success of this effect to unit.

  166. final def unsandbox[R1 <: R, E1, A1 >: A](implicit ev1: <:<[ZIO[R, E, A], ZIO[R1, Cause[E1], A1]]): ZIO[R1, E1, A1]

    Permalink

    The inverse operation to sandbox.

    The inverse operation to sandbox. Submerges the full cause of failure.

  167. final def untraced: ZIO[R, E, A]

    Permalink

    Disables ZIO tracing facilities for the duration of the effect.

    Disables ZIO tracing facilities for the duration of the effect.

    Note: ZIO tracing is cached, as such after the first iteration it has a negligible effect on performance of hot-spots (Additional hash map lookup per flatMap). As such, using untraced sections is not guaranteed to result in a noticeable performance increase.

  168. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  171. final def when[R1 <: R, E1 >: E](b: Boolean): ZIO[R1, E1, Unit]

    Permalink

    The moral equivalent of if (p) exp

  172. final def whenM[R1 <: R, E1 >: E](b: URIO[R1, Boolean]): ZIO[R1, E1, Unit]

    Permalink

    The moral equivalent of if (p) exp when p has side-effects

  173. final def withFilter[E1 >: E](predicate: (A) ⇒ Boolean)(implicit ev1: <:<[NoSuchElementException, E1], ev2: CanFail[E]): ZIO[R, E1, A]

    Permalink

    Enables to check conditions in the value produced by ZIO If the condition is not satisfied, it fails with NoSuchElementException this provide the syntax sugar in for-comprehension: for { (i, j) <- io1 positive <- io2 if positive > 0 } yield ()

  174. final def zip[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (A, B)]

    Permalink

    A named alias for &&& or <*>.

  175. final def zipLeft[R1 <: R, E1 >: E, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, A]

    Permalink

    A named alias for <*.

  176. final def zipPar[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (A, B)]

    Permalink

    A named alias for <&>.

  177. final def zipParLeft[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, A]

    Permalink

    A named alias for <&.

  178. final def zipParRight[R1 <: R, E1 >: E, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    A named alias for &>.

  179. final def zipRight[R1 <: R, E1 >: E, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    A named alias for *>.

  180. final def zipWith[R1 <: R, E1 >: E, B, C](that: ⇒ ZIO[R1, E1, B])(f: (A, B) ⇒ C): ZIO[R1, E1, C]

    Permalink

    Sequentially zips this effect with the specified effect using the specified combiner function.

  181. final def zipWithPar[R1 <: R, E1 >: E, B, C](that: ZIO[R1, E1, B])(f: (A, B) ⇒ C): ZIO[R1, E1, C]

    Permalink

    Returns an effect that executes both this effect and the specified effect, in parallel, combining their results with the specified f function.

    Returns an effect that executes both this effect and the specified effect, in parallel, combining their results with the specified f function. If either side fails, then the other side will be interrupted.

  182. final def |||[R1, E1 >: E, A1 >: A](that: ZIO[R1, E1, A1]): ZIO[Either[R, R1], E1, A1]

    Permalink

Deprecated Value Members

  1. final def const[B](b: ⇒ B): ZIO[R, E, B]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use as

  2. final def succeedLazy[A](a: ⇒ A): UIO[A]

    Permalink

    Returns an effect that models success with the specified lazily-evaluated value.

    Returns an effect that models success with the specified lazily-evaluated value. This method should not be used to capture effects. See ZIO.effectTotal for capturing total effects, and ZIO.effect for capturing partial effects.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use effectTotal

  3. final def void: ZIO[R, E, Unit]

    Permalink

    Returns the effect resulting from mapping the success of this effect to unit.

    Returns the effect resulting from mapping the success of this effect to unit.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use unit

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped