TemporalZio

izumi.functional.bio.impl.TemporalZio
open class TemporalZio(val clock: Clock3[ZIO], val zioClock: Clock) extends AsyncZio with Temporal3[ZIO]

Attributes

Graph
Supertypes
trait Temporal3[ZIO]
class AsyncZio
trait Local3[ZIO]
trait ArrowChoice3[ZIO]
trait Arrow3[ZIO]
trait Profunctor3[ZIO]
trait MonadAsk3[ZIO]
trait Ask3[ZIO]
trait RootTrifunctor[ZIO]
trait Async3[ZIO]
trait IO3[ZIO]
trait Panic3[ZIO]
trait Bracket3[ZIO]
trait Error3[ZIO]
trait Monad3[ZIO]
trait Bifunctor3[ZIO]
trait Guarantee3[ZIO]
trait Applicative3[ZIO]
trait Functor3[ZIO]
trait Concurrent3[ZIO]
trait Parallel3[ZIO]
trait RootBifunctor[ZIO]
trait Root
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Inherited types

final type Canceler = F[Any, Nothing, Unit]

Attributes

Inherited from:
Async3

Attributes

Inherited from:
DivergenceHelper

Attributes

Inherited from:
PredefinedHelper
final type Just[+A] = F[Any, Nothing, A]

Attributes

Inherited from:
IO3
final type Or[+E, +A] = F[Any, E, A]

Attributes

Inherited from:
IO3

Value members

Concrete methods

final override def sleep(duration: Duration): ZIO[Any, Nothing, Unit]

Attributes

Definition Classes
final override def timeout[R, E, A](duration: Duration)(r: ZIO[R, E, A]): ZIO[R, E, Option[A]]

Attributes

Definition Classes

Inherited methods

final override def *>[R, E, A, B](f: ZIO[R, E, A], next: => ZIO[R, E, B]): ZIO[R, E, B]

execute two operations in order, return result of second operation

execute two operations in order, return result of second operation

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def <*[R, E, A, B](f: ZIO[R, E, A], next: => ZIO[R, E, B]): ZIO[R, E, A]

execute two operations in order, same as *>, but return result of first operation

execute two operations in order, same as *>, but return result of first operation

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def InnerF: AsyncZio.this.type

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def access[R, E, A](f: R => ZIO[R, E, A]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def andThen[R, R1, E, A](f: ZIO[R, E, R1], g: ZIO[R1, E, A]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def apply[A](effect: => A): F[Any, Throwable, A]

Attributes

Inherited from:
IO3
final override def as[R, E, A, B](r: ZIO[R, E, A])(v: => B): ZIO[R, E, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def ask[R]: ZIO[R, Nothing, R]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def askWith[R, A](f: R => A): ZIO[R, Nothing, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def asking[R, E, A](f: ZIO[R, E, A]): ZIO[R, E, (A, R)]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def async[E, A](register: (Either[E, A] => Unit) => Unit): ZIO[Any, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def asyncCancelable[E, A](register: (Either[E, A] => Unit) => Canceler): ZIO[Any, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def asyncF[R, E, A](register: (Either[E, A] => Unit) => ZIO[R, E, Unit]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def attempt[R, E, A](r: ZIO[R, E, A]): ZIO[R, Nothing, Either[E, A]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def bimap[R, E, A, E2, B](r: ZIO[R, E, A])(f: E => E2, g: A => B): ZIO[R, E2, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def bracket[R, E, A, B](acquire: ZIO[R, E, A])(release: A => ZIO[R, Nothing, Unit])(use: A => ZIO[R, E, B]): ZIO[R, E, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def bracketCase[R, E, A, B](acquire: ZIO[R, E, A])(release: (A, Exit[E, B]) => ZIO[R, Nothing, Unit])(use: A => ZIO[R, E, B]): ZIO[R, E, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def bracketExcept[R, E, A, B](acquire: RestoreInterruption3[ZIO] => ZIO[R, E, A])(release: (A, Exit[E, B]) => ZIO[R, Nothing, Unit])(use: A => ZIO[R, E, B]): ZIO[R, E, B]

Like bracketCase, but acquire can contain marked interruptible regions as in uninterruptibleExcept

Like bracketCase, but acquire can contain marked interruptible regions as in uninterruptibleExcept

Attributes

Definition Classes
Inherited from:
AsyncZio
final def bracketOnFailure[R, E, A, B](acquire: ZIO[R, E, A])(cleanupOnFailure: (A, Failure[E]) => ZIO[R, Nothing, Unit])(use: A => ZIO[R, E, B]): F[R, E, B]

Run release action only on a failure – any failure, INCLUDING interruption. Do not run release action if use finished successfully.

Run release action only on a failure – any failure, INCLUDING interruption. Do not run release action if use finished successfully.

Attributes

Inherited from:
Bracket3
final override def catchAll[R, E, A, E2](r: ZIO[R, E, A])(f: E => ZIO[R, E2, A]): ZIO[R, E2, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def catchSome[R, E, A, E1 >: E](r: ZIO[R, E, A])(f: PartialFunction[E, ZIO[R, E1, A]]): ZIO[R, E1, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def choice[RL, RR, E, A](f: ZIO[RL, E, A], g: ZIO[RR, E, A]): ZIO[Either[RL, RR], E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def choose[RL, RR, E, AL, AR](f: ZIO[RL, E, AL], g: ZIO[RR, E, AR]): ZIO[Either[RL, RR], E, Either[AL, AR]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def contramap[R, E, A, R0](fr: ZIO[R, E, A])(f: R0 => R): ZIO[R0, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def currentEC: ZIO[Any, Nothing, ExecutionContext]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def dimap[R1, E, A1, R2, A2](fab: ZIO[R1, E, A1])(f: R2 => R1)(g: A1 => A2): ZIO[R2, E, A2]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def fail[E](v: => E): ZIO[Any, E, Nothing]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def flatMap[R, E, A, B](r: ZIO[R, E, A])(f0: A => ZIO[R, E, B]): ZIO[R, E, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def flatten[R, E, A](r: ZIO[R, E, ZIO[R, E, A]]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def flip[R, E, A](r: ZIO[R, E, A]): ZIO[R, A, E]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def forever[R, E, A](r: ZIO[R, E, A]): F[R, E, Nothing]

Attributes

Inherited from:
Applicative3
final override def fromEither[E, A](effect: => Either[E, A]): ZIO[Any, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def fromFuture[A](mkFuture: ExecutionContext => Future[A]): ZIO[Any, Throwable, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def fromFuture[A](mkFuture: => Future[A]): F[Any, Throwable, A]

Attributes

Inherited from:
Async3
final override def fromFutureJava[A](javaFuture: => CompletionStage[A]): ZIO[Any, Throwable, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def fromOption[E, A](errorOnNone: => E)(effect: => Option[A]): ZIO[Any, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
def fromOption[R, E, A](errorOnNone: => E, r: ZIO[R, E, Option[A]]): F[R, E, A]

Extracts the optional value or fails with the errorOnNone error

Extracts the optional value or fails with the errorOnNone error

Attributes

Inherited from:
Error3
final override def fromOptionF[R, E, A](fallbackOnNone: => ZIO[R, E, A], r: ZIO[R, E, Option[A]]): ZIO[R, E, A]

Extracts the optional value, or executes the fallbackOnNone effect

Extracts the optional value, or executes the fallbackOnNone effect

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def fromOptionOr[R, E, A](valueOnNone: => A, r: ZIO[R, E, Option[A]]): ZIO[R, E, A]

Extracts the optional value, or returns the given valueOnNone value

Extracts the optional value, or returns the given valueOnNone value

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def fromTry[A](effect: => Try[A]): ZIO[Any, Throwable, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def guarantee[R, E, A](f: ZIO[R, E, A], cleanup: ZIO[R, Nothing, Unit]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def guaranteeCase[R, E, A](f: ZIO[R, E, A], cleanup: Exit[E, A] => ZIO[R, Nothing, Unit]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def guaranteeExceptOnInterrupt[R, E, A](f: ZIO[R, E, A], cleanupOnNonInterruption: Either[Termination, Either[Error[E], Success[A]]] => ZIO[R, Nothing, Unit]): F[R, E, A]

Run cleanup on both success and failure, if the failure IS NOT an interruption.

Run cleanup on both success and failure, if the failure IS NOT an interruption.

Attributes

Inherited from:
Bracket3
final def guaranteeOnFailure[R, E, A](f: ZIO[R, E, A], cleanupOnFailure: Failure[E] => ZIO[R, Nothing, Unit]): F[R, E, A]

Run cleanup only on a failure – any failure, INCLUDING interruption. Do not run cleanup if use finished successfully.

Run cleanup only on a failure – any failure, INCLUDING interruption. Do not run cleanup if use finished successfully.

Attributes

Inherited from:
Bracket3
final def guaranteeOnInterrupt[R, E, A](f: ZIO[R, E, A], cleanupOnInterruption: Interruption => ZIO[R, Nothing, Unit]): F[R, E, A]

Run cleanup only on interruption. Do not run cleanup if use finished successfully.

Run cleanup only on interruption. Do not run cleanup if use finished successfully.

Attributes

Inherited from:
Bracket3
final def ifThenElse[R, E, E1, A](cond: ZIO[R, E, Boolean])(ifTrue: => ZIO[R, E1, A], ifFalse: => ZIO[R, E1, A])(implicit ev: E <:< E1): F[R, E1, A]

Attributes

Inherited from:
Monad3
final def ifThenElse[R, E, A](cond: Boolean)(ifTrue: => ZIO[R, E, A], ifFalse: => ZIO[R, E, A]): F[R, E, A]

Attributes

Inherited from:
Applicative3
final override def iterateUntil[R, E, A](r: ZIO[R, E, A])(p: A => Boolean): ZIO[R, E, A]

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Attributes

Definition Classes
Inherited from:
AsyncZio
def iterateUntilF[R, E, A](init: A)(f: A => ZIO[R, E, A])(p: A => Boolean): F[R, E, A]

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Attributes

Inherited from:
Monad3
final override def iterateWhile[R, E, A](r: ZIO[R, E, A])(p: A => Boolean): ZIO[R, E, A]

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Attributes

Definition Classes
Inherited from:
AsyncZio
def iterateWhileF[R, E, A](init: A)(f: A => ZIO[R, E, A])(p: A => Boolean): F[R, E, A]

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Attributes

Inherited from:
Monad3
final override def leftFlatMap[R, E, A, E2](r: ZIO[R, E, A])(f: E => ZIO[R, Nothing, E2]): ZIO[R, E2, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def leftMap[R, E, A, E2](r: ZIO[R, E, A])(f: E => E2): ZIO[R, E2, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def leftMap2[R, E, A, E2, E3](firstOp: ZIO[R, E, A], secondOp: => ZIO[R, E2, A])(f: (E, E2) => E3): ZIO[R, E3, A]

map errors from two operations into a new error if both fail

map errors from two operations into a new error if both fail

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def map[R, E, A, B](r: ZIO[R, E, A])(f: A => B): ZIO[R, E, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def map2[R, E, A, B, C](r1: ZIO[R, E, A], r2: => ZIO[R, E, B])(f: (A, B) => C): ZIO[R, E, C]

execute two operations in order, map their results

execute two operations in order, map their results

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def never: ZIO[Any, Nothing, Nothing]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def onEC[R, E, A](ec: ExecutionContext)(f: ZIO[R, E, A]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def orElse[R, E, A, E2](r: ZIO[R, E, A], f: => ZIO[R, E2, A]): ZIO[R, E2, A]

execute second operation only if the first one fails

execute second operation only if the first one fails

Attributes

Definition Classes
Inherited from:
AsyncZio
final def orTerminate[R, A](r: ZIO[R, Throwable, A]): F[R, Nothing, A]

Attributes

Inherited from:
Panic3
final override def parTraverse[R, E, A, B](l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, List[B]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def parTraverseN[R, E, A, B](maxConcurrent: Int)(l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, List[B]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def parTraverseNCore[R, E, A, B](l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, List[B]]

parTraverseN with maxConcurrent set to the number of cores, or 2 when on single-core processor

parTraverseN with maxConcurrent set to the number of cores, or 2 when on single-core processor

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def parTraverseNCore_[R, E, A, B](l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def parTraverseN_[R, E, A, B](maxConcurrent: Int)(l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def parTraverse_[R, E, A, B](l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def provide[R, E, A](fr: ZIO[R, E, A])(r: => R): ZIO[Any, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def pure[A](a: A): ZIO[Any, Nothing, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def race[R, E, A](r1: ZIO[R, E, A], r2: ZIO[R, E, A]): ZIO[R, E, A]

Race two actions, the winner is the first action to TERMINATE, whether by success or failure

Race two actions, the winner is the first action to TERMINATE, whether by success or failure

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def racePairUnsafe[R, E, A, B](r1: ZIO[R, E, A], r2: ZIO[R, E, B]): ZIO[R, E, Either[(Exit[E, A], Fiber3[ZIO, E, B]), (Fiber3[ZIO, E, A], Exit[E, B])]]

Race two actions, the winner is the first action to TERMINATE, whether by success or failure

Race two actions, the winner is the first action to TERMINATE, whether by success or failure

Unlike race, the loser is not interrupted after the winner has terminated - whether by success or failure.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def redeem[R, E, A, E2, B](r: ZIO[R, E, A])(err: E => ZIO[R, E2, B], succ: A => ZIO[R, E2, B]): ZIO[R, E2, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def redeemPure[R, E, A, B](r: ZIO[R, E, A])(err: E => B, succ: A => B): ZIO[R, Nothing, B]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def repeatUntil[R, E, A](action: ZIO[R, E, Option[A]])(tooManyAttemptsError: => E, sleep: FiniteDuration, maxAttempts: Int): F[R, E, A]

Attributes

Inherited from:
Temporal3
final def retryOrElseUntil[R, E, A, E2](r: ZIO[R, E, A])(duration: FiniteDuration, orElse: E => ZIO[R, E2, A]): F[R, E2, A]

Attributes

Inherited from:
Temporal3
final override def retryUntil[R, E, A](r: ZIO[R, E, A])(f: E => Boolean): ZIO[R, E, A]

Retries this effect until its error satisfies the specified predicate.

Retries this effect until its error satisfies the specified predicate.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def retryUntilF[R, R1 <: R, E, A](r: ZIO[R, E, A])(f: E => ZIO[R1, Nothing, Boolean]): ZIO[R1, E, A]

Retries this effect until its error satisfies the specified effectful predicate.

Retries this effect until its error satisfies the specified effectful predicate.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def retryWhile[R, E, A](r: ZIO[R, E, A])(f: E => Boolean): ZIO[R, E, A]

Retries this effect while its error satisfies the specified predicate.

Retries this effect while its error satisfies the specified predicate.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def retryWhileF[R, R1 <: R, E, A](r: ZIO[R, E, A])(f: E => ZIO[R1, Nothing, Boolean]): ZIO[R1, E, A]

Retries this effect while its error satisfies the specified effectful predicate.

Retries this effect while its error satisfies the specified effectful predicate.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def sandbox[R, E, A](r: ZIO[R, E, A]): ZIO[R, Failure[E], A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def sendInterruptToSelf: ZIO[Any, Nothing, Unit]

Signal interruption to this fiber.

Signal interruption to this fiber.

This is NOT the same as

 F.halt(Exit.Interrupted(Trace.empty))

The code above exits with Exit.Interrupted failure unconditionally, whereas sendInterruptToSelf will not exit when in an uninterruptible region. Example:

 F.uninterruptible {
   F.halt(Exit.Interrupted(Trace.empty)) *>
   F.sync(println("Hello!")) // interrupted above. Hello _not_ printed
 }

But with sendInterruptToSelf:

 F.uninterruptible {
   F.sendInterruptToSelf *>
   F.sync(println("Hello!")) // Hello IS printed.
 } *> F.sync(println("Impossible")) // interrupted immediately after `uninterruptible` block ends. Impossible _not_ printed

Attributes

See also:
Definition Classes
Inherited from:
AsyncZio
final override def sequence[R, E, A, B](l: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def sequence_[R, E](l: Iterable[ZIO[R, E, Unit]]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def suspend[R, A](effect: => ZIO[R, Throwable, A]): ZIO[R, Throwable, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def sync[A](effect: => A): ZIO[Any, Nothing, A]

Capture an exception-safe side-effect such as memory mutation or randomness

Capture an exception-safe side-effect such as memory mutation or randomness

Attributes

Note:

If you're not completely sure that a captured block can't throw, use syncThrowable

sync means synchronous, that is, a blocking CPU effect, as opposed to a non-blocking asynchronous effect or a long blocking I/O effect (izumi.functional.bio.BlockingIO3#syncBlocking)

Example:
import izumi.functional.bio.F
val referentiallyTransparentArrayAllocation: F[Nothing, Array[Byte]] = {
 F.sync(new Array(256))
}
Definition Classes
Inherited from:
AsyncZio
final override def syncThrowable[A](effect: => A): ZIO[Any, Throwable, A]

Capture a side-effectful block of code that can throw exceptions

Capture a side-effectful block of code that can throw exceptions

Attributes

Note:

sync means synchronous, that is, a blocking CPU effect, as opposed to a non-blocking asynchronous effect or a long blocking I/O effect (izumi.functional.bio.BlockingIO3#syncBlocking)

Definition Classes
Inherited from:
AsyncZio
def tailRecM[R, E, A, B](a: A)(f: A => ZIO[R, E, Either[A, B]]): F[R, E, B]

Attributes

Inherited from:
Monad3
final override def tap[R, E, A](r: ZIO[R, E, A], f: A => ZIO[R, E, Unit]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def tapBoth[R, E, A, E1 >: E](r: ZIO[R, E, A])(err: E => ZIO[R, E1, Unit], succ: A => ZIO[R, E1, Unit]): ZIO[R, E1, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def tapError[R, E, A, E1 >: E](r: ZIO[R, E, A])(f: E => ZIO[R, E1, Unit]): ZIO[R, E1, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def terminate(v: => Throwable): ZIO[Any, Nothing, Nothing]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def timeoutFail[R, E, A](duration: Duration)(e: => E, r: ZIO[R, E, A]): F[R, E, A]

Attributes

Inherited from:
Temporal3
final override def traverse[R, E, A, B](l: Iterable[A])(f: A => ZIO[R, E, B]): ZIO[R, E, List[B]]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def traverse[R, E, A, B](o: Option[A])(f: A => ZIO[R, E, B]): F[R, E, Option[B]]

Attributes

Inherited from:
Applicative3
final override def traverse_[R, E, A](l: Iterable[A])(f: A => ZIO[R, E, Unit]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def uninterruptible[R, E, A](r: ZIO[R, E, A]): ZIO[R, E, A]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def uninterruptibleExcept[R, E, A](r: Morphism3[ZIO, ZIO] => ZIO[R, E, A]): ZIO[R, E, A]

Designate the effect uninterruptible, with exception of regions in it that are specifically marked to restore previous interruptibility status using the provided RestoreInterruption function

Designate the effect uninterruptible, with exception of regions in it that are specifically marked to restore previous interruptibility status using the provided RestoreInterruption function

Attributes

Note:

Interruptibility status will be restored to what it was in the outer region, so if the outer region was also uninterruptible, the provided RestoreInterruption will have no effect. e.g. the expression F.uninterruptible { F.uninterruptibleExcept { restore => restore(F.sleep(1.second)) } is fully uninterruptible throughout

Example:
 F.uninterruptibleExcept {
   restoreInterruption =>
     val workLoop = {
       importantWorkThatMustNotBeInterrupted() *>
       log.info("Taking a break for a second, you can interrupt me while I wait!") *>
       restoreInterruption.apply {
         F.sleep(1.second)
          .guaranteeOnInterrupt(_ => log.info("Got interrupted!"))
       } *>
       log.info("No interruptions, going back to work!") *>
       workLoop
     }
     workLoop
 }
Definition Classes
Inherited from:
AsyncZio
final override def unit: ZIO[Any, Nothing, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def unless[R, E, E1](cond: ZIO[R, E, Boolean])(ifFalse: => ZIO[R, E1, Unit])(implicit ev: E <:< E1): F[R, E1, Unit]

Attributes

Inherited from:
Monad3
final def unless[R, E](cond: Boolean)(ifFalse: => ZIO[R, E, Unit]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
final override def void[R, E, A](r: ZIO[R, E, A]): ZIO[R, E, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final def when[R, E, E1](cond: ZIO[R, E, Boolean])(ifTrue: => ZIO[R, E1, Unit])(implicit ev: E <:< E1): F[R, E1, Unit]

Attributes

Inherited from:
Monad3
final def when[R, E](cond: Boolean)(ifTrue: => ZIO[R, E, Unit]): F[R, E, Unit]

Attributes

Inherited from:
Applicative3
final def widen[R, E, A, A1](r: ZIO[R, E, A])(implicit ev: A <:< A1): F[R, E, A1]

Attributes

Inherited from:
Functor3
final def widenBoth[R, E, A, E1, A1](r: ZIO[R, E, A])(implicit ev: E <:< E1, ev2: A <:< A1): F[R, E1, A1]

Attributes

Inherited from:
Bifunctor3
final def widenError[R, E, A, E1](r: ZIO[R, E, A])(implicit ev: E <:< E1): F[R, E1, A]

Attributes

Inherited from:
Bifunctor3
final def withFilter[R, E, A](r: ZIO[R, E, A])(predicate: A => Boolean)(implicit filter: WithFilter[E], pos: SourceFilePositionMaterializer): F[R, E, A]

for-comprehensions sugar:

for-comprehensions sugar:

 for {
   (1, 2) <- F.pure((2, 1))
 } yield ()

Use widenError to for pattern matching with non-Throwable errors:

 val f = for {
   (1, 2) <- F.pure((2, 1)).widenError[Option[Unit]]
 } yield ()
 // f: F[Option[Unit], Unit] = F.fail(Some(())

Attributes

Inherited from:
Error3
final override def yieldNow: ZIO[Any, Nothing, Unit]

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def zipPar[R, E, A, B](fa: ZIO[R, E, A], fb: ZIO[R, E, B]): ZIO[R, E, (A, B)]

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

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

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def zipParLeft[R, E, A, B](fa: ZIO[R, E, A], fb: ZIO[R, E, B]): ZIO[R, E, A]

Returns an effect that executes both effects, in parallel, the left effect result is returned. If either side fails, then the other side will be interrupted.

Returns an effect that executes both effects, in parallel, the left effect result is returned. If either side fails, then the other side will be interrupted.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def zipParRight[R, E, A, B](fa: ZIO[R, E, A], fb: ZIO[R, E, B]): ZIO[R, E, B]

Returns an effect that executes both effects, in parallel, the right effect result is returned. If either side fails, then the other side will be interrupted.

Returns an effect that executes both effects, in parallel, the right effect result is returned. If either side fails, then the other side will be interrupted.

Attributes

Definition Classes
Inherited from:
AsyncZio
final override def zipWithPar[R, E, A, B, C](fa: ZIO[R, E, A], fb: ZIO[R, E, B])(f: (A, B) => C): ZIO[R, E, C]

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

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

Attributes

Definition Classes
Inherited from:
AsyncZio

Concrete fields

override val clock: Clock3[ZIO]