Class

scalaz.zio.ZIO

Fork

Related Doc: package ZIO

Permalink

final class Fork[E, A] extends UIO[Fiber[E, A]]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fork
  2. ZIO
  3. Serializable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Fork(value: IO[E, A])

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def *>[R1 <: Any, E1 >: Nothing, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

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

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

    Definition Classes
    ZIO
  4. final def <*[R1 <: Any, E1 >: Nothing, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  5. final def <>[R1 <: Any, E2, A1 >: Fiber[E, A]](that: ⇒ ZIO[R1, E2, A1]): ZIO[R1, E2, A1]

    Permalink

    Operator alias for orElse.

    Operator alias for orElse.

    Definition Classes
    ZIO
  6. final def ==(arg0: Any): Boolean

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

    Permalink

    Alias for flatMap.

    Alias for flatMap.

    val parsed = readFile("foo.txt") >>= parseFile
    Definition Classes
    ZIO
  8. final def absolve[R1 <: Any, E1, B](implicit ev1: <:<[ZIO[Any, Nothing, Fiber[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.

    Definition Classes
    ZIO
  9. final def absorb(implicit ev: <:<[Nothing, Throwable]): ZIO[Any, Throwable, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  10. final def absorbWith(f: (Nothing) ⇒ Throwable): ZIO[Any, Throwable, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. final def bimap[E2, B](f: (Nothing) ⇒ E2, g: (Fiber[E, A]) ⇒ B): ZIO[Any, E2, B]

    Permalink

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

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

    Definition Classes
    ZIO
  13. final def bracketOnError[R1 <: Any, E1 >: Nothing, B](release: (Fiber[E, A]) ⇒ ZIO[R1, Nothing, _])(use: (Fiber[E, A]) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Executes the release effect only if there was an error.

    Executes the release effect only if there was an error.

    Definition Classes
    ZIO
  14. final def bracket_[R1 <: Any, E1 >: Nothing, B](release: ZIO[R1, Nothing, _], use: ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Uncurried version.

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

    Definition Classes
    ZIO
  15. final def bracket_[R1 <: Any, E1 >: Nothing]: BracketAcquire_[R1, E1]

    Permalink

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

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

    Definition Classes
    ZIO
  16. final def catchAll[R1 <: Any, E2, A1 >: Fiber[E, A]](h: (Nothing) ⇒ ZIO[R1, E2, A1]): ZIO[R1, E2, A1]

    Permalink

    Recovers from all errors.

    Recovers from all errors.

    openFile("config.json").catchAll(_ => IO.succeed(defaultConfig))
    Definition Classes
    ZIO
  17. final def catchSome[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, A]](pf: PartialFunction[Nothing, ZIO[R1, E1, A1]]): 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")
    }
    Definition Classes
    ZIO
  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def const[B](b: ⇒ B): ZIO[Any, Nothing, B]

    Permalink

    Maps this effect to the specified constant while preserving the effects of this effect.

    Maps this effect to the specified constant while preserving the effects of this effect.

    Definition Classes
    ZIO
  20. final def delay(duration: Duration): ZIO[Clock, Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  21. final def either: ZIO[Any, Nothing, Either[Nothing, Fiber[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.

    Definition Classes
    ZIO
  22. final def ensuring(finalizer: UIO[_]): ZIO[Any, Nothing, Fiber[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.

    Definition Classes
    ZIO
  23. final def ensuringR[R1 <: Any](finalizer: ZIO[R1, Nothing, _]): ZIO[R1, Nothing, Fiber[E, A]]

    Permalink

    Executes the specified finalizer, providing the environment of this ZIO directly and immediately to the finalizer.

    Executes the specified finalizer, providing the environment of this ZIO directly and immediately to the finalizer. This method should not be used for cleaning up resources, because it's possible the fiber will be interrupted after acquisition but before the finalizer is added.

    Definition Classes
    ZIO
  24. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. final def flatMap[R1 <: Any, E1 >: Nothing, B](k: (Fiber[E, 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))
    Definition Classes
    ZIO
  28. final def flatMapError[R1 <: Any, E2](f: (Nothing) ⇒ ZIO[R1, Nothing, E2]): ZIO[R1, E2, Fiber[E, 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))
    Definition Classes
    ZIO
  29. final def flatten[R1 <: Any, E1 >: Nothing, B](implicit ev1: <:<[Fiber[E, 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.

    Definition Classes
    ZIO
  30. final def flip: ZIO[Any, Fiber[E, A], Nothing]

    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.

    Definition Classes
    ZIO
  31. final def flipWith[R1, A1, E1](f: (ZIO[Any, Fiber[E, A], Nothing]) ⇒ ZIO[R1, A1, E1]): ZIO[R1, E1, A1]

    Permalink

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

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

    Definition Classes
    ZIO
  32. final def fold[B](err: (Nothing) ⇒ B, succ: (Fiber[E, A]) ⇒ B): ZIO[Any, Nothing, 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.

    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.

    Definition Classes
    ZIO
  33. final def foldCauseM[R1 <: Any, E2, B](err: (Cause[Nothing]) ⇒ ZIO[R1, E2, B], succ: (Fiber[E, 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.

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

    Definition Classes
    ZIO
  34. final def foldM[R1 <: Any, E2, B](err: (Nothing) ⇒ ZIO[R1, E2, B], succ: (Fiber[E, A]) ⇒ ZIO[R1, E2, B]): 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.

    Definition Classes
    ZIO
  35. final def forever: ZIO[Any, Nothing, 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.

    Definition Classes
    ZIO
  36. final def fork: ZIO[Any, Nothing, Fiber[Nothing, 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 scalaz.zio.Fiber for more information.

    for {
      fiber <- subtask.fork
      // Do stuff...
      a <- fiber.join
    } yield a
    Definition Classes
    ZIO
  37. final def forkOn(ec: ExecutionContext): ZIO[Any, Nothing, Fiber[Nothing, Fiber[E, A]]]

    Permalink

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

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

    Definition Classes
    ZIO
  38. final def get[E1 >: Nothing, B](implicit ev1: =:=[E1, Nothing], ev2: <:<[Fiber[E, A], Option[B]]): ZIO[Any, Unit, B]

    Permalink

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

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

    Definition Classes
    ZIO
  39. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  42. final def lock(executor: Executor): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

    Returns an effect whose execution is locked to the specified executor.

    Returns an effect whose execution is locked to the specified executor. 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.

    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.

    Definition Classes
    ZIO
  43. final def map[B](f: (Fiber[E, A]) ⇒ B): ZIO[Any, Nothing, B]

    Permalink

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

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

    Definition Classes
    ZIO
  44. final def mapError[E2](f: (Nothing) ⇒ E2): ZIO[Any, E2, Fiber[E, 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.

    Definition Classes
    ZIO
  45. final def memoize: ZIO[Any, Nothing, IO[Nothing, Fiber[E, A]]]

    Permalink

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

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

    Definition Classes
    ZIO
  46. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  49. final def on(ec: ExecutionContext): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  50. final def onError(cleanup: (Cause[Nothing]) ⇒ UIO[_]): ZIO[Any, Nothing, Fiber[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.

    Definition Classes
    ZIO
  51. final def onInterrupt(cleanup: UIO[_]): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

    Runs the specified effect if this effect is interrupted.

    Runs the specified effect if this effect is interrupted.

    Definition Classes
    ZIO
  52. final def onTermination(cleanup: (Cause[Nothing]) ⇒ UIO[_]): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  53. final def option: ZIO[Any, Nothing, Option[Fiber[E, A]]]

    Permalink

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

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

    Definition Classes
    ZIO
  54. final def orDie[E1 >: Nothing](implicit ev: <:<[E1, Throwable]): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  55. final def orDieWith(f: (Nothing) ⇒ Throwable): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  56. final def orElse[R1 <: Any, E2, A1 >: Fiber[E, A]](that: ⇒ ZIO[R1, E2, A1]): ZIO[R1, E2, A1]

    Permalink

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

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

    Definition Classes
    ZIO
  57. final def orElseEither[R1 <: Any, E2, B](that: ⇒ ZIO[R1, E2, B]): ZIO[R1, E2, Either[Fiber[E, 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.

    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.

    Definition Classes
    ZIO
  58. final def provide(r: Any): IO[Nothing, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  59. final def provideSome[R0](f: (R0) ⇒ Any): ZIO[R0, Nothing, Fiber[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](console =>
      new Console with Logging {
        val console = console
        val logging = new Logging
          def log(line: String) = console.putStrLn(line)
        }
      }
    )
    Definition Classes
    ZIO
  60. final def provideSomeM[R0, R1 >: R0, E1 >: Nothing](f: (R1) ⇒ ZIO[R0, E1, Any]): ZIO[R0, E1, Fiber[E, 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.

    Definition Classes
    ZIO
  61. final def race[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, 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.

    Definition Classes
    ZIO
  62. def raceAll[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, 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

    Definition Classes
    ZIO
  63. final def raceAttempt[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, 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.

    Definition Classes
    ZIO
  64. final def raceEither[R1 <: Any, E1 >: Nothing, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, Either[Fiber[E, 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.

    Definition Classes
    ZIO
  65. final def raceWith[R1 <: Any, E1, E2, B, C](that: ZIO[R1, E1, B])(leftDone: (Exit[Nothing, Fiber[E, A]], Fiber[E1, B]) ⇒ ZIO[R1, E2, C], rightDone: (Exit[E1, B], Fiber[Nothing, 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.

    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.

    Definition Classes
    ZIO
  66. final def refineOrDie[E1](pf: PartialFunction[Nothing, E1])(implicit ev: <:<[Nothing, Throwable]): ZIO[Any, E1, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  67. final def refineOrDieWith[E1](pf: PartialFunction[Nothing, E1])(f: (Nothing) ⇒ Throwable): ZIO[Any, E1, Fiber[E, 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.

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

    Definition Classes
    ZIO
  68. final def repeat[R1 <: Any, B](schedule: ZSchedule[R1, Fiber[E, A], B]): ZIO[R1 with Clock, Nothing, 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".

    Definition Classes
    ZIO
  69. final def repeatOrElse[R1 <: Any, E2, B](schedule: ZSchedule[R1, Fiber[E, A], B], orElse: (Nothing, Option[B]) ⇒ ZIO[R1, E2, B]): ZIO[R1 with Clock, 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.

    Definition Classes
    ZIO
  70. final def repeatOrElseEither[R1 <: Any, B, E2, C](schedule: ZSchedule[R1, Fiber[E, A], B], orElse: (Nothing, Option[B]) ⇒ ZIO[R1 with Clock, E2, C]): ZIO[R1 with Clock, 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.

    Definition Classes
    ZIO
  71. final def retry[R1 <: Any, E1 >: Nothing, S](policy: ZSchedule[R1, E1, S]): ZIO[R1 with Clock, E1, Fiber[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".

    Definition Classes
    ZIO
  72. final def retryOrElse[R1 <: Any, A2 >: Fiber[E, A], E1 >: Nothing, S, E2](policy: ZSchedule[R1, E1, S], orElse: (E1, S) ⇒ ZIO[R1, E2, A2]): ZIO[R1 with Clock, 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.

    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.

    Definition Classes
    ZIO
  73. final def retryOrElseEither[R1 <: Any, E1 >: Nothing, S, E2, B](policy: ZSchedule[R1, E1, S], orElse: (E1, S) ⇒ ZIO[R1, E2, B]): ZIO[R1 with Clock, E2, Either[B, Fiber[E, 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.

    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.

    Definition Classes
    ZIO
  74. final def run: ZIO[Any, Nothing, Exit[Nothing, Fiber[E, A]]]

    Permalink

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

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

    Definition Classes
    ZIO
  75. final def sandbox: ZIO[Any, Cause[Nothing], Fiber[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)
       *
      }
    Definition Classes
    ZIO
  76. final def sandboxWith[R1 <: Any, E2, B](f: (ZIO[R1, Cause[Nothing], Fiber[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

    Definition Classes
    ZIO
  77. final def summarized[R1 <: Any, E1 >: Nothing, B, C](f: (B, B) ⇒ C)(summary: ZIO[R1, E1, B]): ZIO[R1, E1, (C, Fiber[E, 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.

    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.

    Definition Classes
    ZIO
  78. final def supervise: ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

    Supervises this effect, which ensures that any fibers that are forked by the effect are interrupted when this effect completes.

    Supervises this effect, which ensures that any fibers that are forked by the effect are interrupted when this effect completes.

    Definition Classes
    ZIO
  79. final def superviseWith(supervisor: (Iterable[Fiber[_, _]]) ⇒ UIO[_]): ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

    Supervises this effect, which ensures that any fibers that are forked by the effect are handled by the provided supervisor.

    Supervises this effect, which ensures that any fibers that are forked by the effect are handled by the provided supervisor.

    Definition Classes
    ZIO
  80. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  81. 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).

    Definition Classes
    ForkZIO
  82. final def tap[R1 <: Any, E1 >: Nothing](f: (Fiber[E, A]) ⇒ ZIO[R1, E1, _]): ZIO[R1, E1, Fiber[E, 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)
    Definition Classes
    ZIO
  83. final def tapBoth[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, A]](f: (Nothing) ⇒ ZIO[R1, E1, _], g: (Fiber[E, A]) ⇒ ZIO[R1, E1, _]): ZIO[R1, E1, Fiber[E, A]]

    Permalink

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

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

    readFile("data.json").tapBoth(logError(_), logData(_))
    Definition Classes
    ZIO
  84. final def timed: ZIO[Clock, Nothing, (Duration, Fiber[E, A])]

    Permalink

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

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

    Definition Classes
    ZIO
  85. final def timedWith[R1 <: Any, E1 >: Nothing](nanoTime: ZIO[R1, E1, Long]): ZIO[R1, E1, (Duration, Fiber[E, A])]

    Permalink

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

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

    Definition Classes
    ZIO
  86. final def timeout(d: Duration): ZIO[Clock, Nothing, Option[Fiber[E, 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

    Definition Classes
    ZIO
  87. final def timeoutFail[E1 >: Nothing](e: E1)(d: Duration): ZIO[Clock, E1, Fiber[E, A]]

    Permalink

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

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

    Definition Classes
    ZIO
  88. final def timeoutTo[R1 <: Any, E1 >: Nothing, A1 >: Fiber[E, 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)
    Definition Classes
    ZIO
  89. final def to[E1 >: Nothing, A1 >: Fiber[E, A]](p: Promise[E1, A1]): ZIO[Any, Nothing, 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.

    Definition Classes
    ZIO
  90. final def toFuture(implicit ev2: <:<[Nothing, Throwable]): ZIO[Any, Nothing, Future[Fiber[E, A]]]

    Permalink

    Converts the effect to a scala.concurrent.Future.

    Converts the effect to a scala.concurrent.Future.

    Definition Classes
    ZIO
  91. final def toFutureWith(f: (Nothing) ⇒ Throwable): ZIO[Any, Nothing, Future[Fiber[E, A]]]

    Permalink

    Converts the effect into a scala.concurrent.Future.

    Converts the effect into a scala.concurrent.Future.

    Definition Classes
    ZIO
  92. final def toManaged(release: (Fiber[E, A]) ⇒ UIO[_]): ZManaged[Any, Nothing, Fiber[E, A]]

    Permalink

    Converts this ZIO to scalaz.zio.Managed.

    Converts this ZIO to scalaz.zio.Managed.

    Definition Classes
    ZIO
  93. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  94. final def uninterruptible: ZIO[Any, Nothing, Fiber[E, A]]

    Permalink

    Performs this effect non-interruptibly.

    Performs this effect non-interruptibly. 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.

    Definition Classes
    ZIO
  95. final def unsandbox[R1 <: Any, E1, A1 >: Fiber[E, A]](implicit ev1: <:<[ZIO[Any, Nothing, Fiber[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.

    Definition Classes
    ZIO
  96. val value: IO[E, A]

    Permalink
  97. final def void: ZIO[Any, Nothing, 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.

    Definition Classes
    ZIO
  98. final def wait(): Unit

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

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

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

    Permalink

    The moral equivalent of if (p) exp

    The moral equivalent of if (p) exp

    Definition Classes
    ZIO
  102. final def whenM[R1 <: Any, E1 >: Nothing](b: ZIO[R1, Nothing, Boolean]): ZIO[R1, E1, Unit]

    Permalink

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

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

    Definition Classes
    ZIO
  103. final def zip[R1 <: Any, E1 >: Nothing, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (Fiber[E, A], B)]

    Permalink

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

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

    Definition Classes
    ZIO
  104. final def zipLeft[R1 <: Any, E1 >: Nothing, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, Fiber[E, A]]

    Permalink

    A named alias for <*.

    A named alias for <*.

    Definition Classes
    ZIO
  105. final def zipPar[R1 <: Any, E1 >: Nothing, B](that: ZIO[R1, E1, B]): ZIO[R1, E1, (Fiber[E, 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.

    Definition Classes
    ZIO
  106. final def zipRight[R1 <: Any, E1 >: Nothing, B](that: ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    A named alias for *>.

    A named alias for *>.

    Definition Classes
    ZIO
  107. final def zipWith[R1 <: Any, E1 >: Nothing, B, C](that: ZIO[R1, E1, B])(f: (Fiber[E, A], B) ⇒ C): ZIO[R1, E1, C]

    Permalink

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

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

    Definition Classes
    ZIO
  108. final def zipWithPar[R1 <: Any, E1 >: Nothing, B, C](that: ZIO[R1, E1, B])(f: (Fiber[E, 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.

    Definition Classes
    ZIO

Inherited from ZIO[Any, Nothing, Fiber[E, A]]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped