Attributes
- Companion:
- class
- Graph
- Supertypes
- class AsyncZiotrait 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 ApplicativeError3[ZIO]trait Bifunctor3[ZIO]trait Guarantee3[ZIO]trait Applicative3[ZIO]trait Functor3[ZIO]trait Concurrent3[ZIO]trait Parallel3[ZIO]trait RootBifunctor[ZIO]trait Roottrait PredefinedHelpertrait DivergenceHelperclass Objecttrait Matchableclass Any
- Self type
- AsyncZio.type
Members list
Type members
Value members
Inherited methods
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
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
Attributes
- Definition Classes
- AsyncZio -> Local3 -> Profunctor3 -> MonadAsk3 -> Ask3 -> Async3 -> ApplicativeError3 -> Bifunctor3 -> Concurrent3 -> Parallel3
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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
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
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Inherited from:
- Applicative3
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Inherited from:
- Async3
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Extracts the optional value or fails with the errorOnNone
error
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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
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
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
Attributes
- Inherited from:
- Monad3
Attributes
- Inherited from:
- Applicative3
Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.
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
Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.
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
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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
execute two operations in order, map their results
execute two operations in order, map their results
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
execute second operation only if the first one fails
execute second operation only if the first one fails
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Inherited from:
- Panic3
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
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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
Race two actions, the winner is the first action to TERMINATE, whether by success or failure
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:
- https://github.com/zio/interop-cats/issues/503 - History of supporting this method in ZIO
- https://github.com/zio/zio/issues/6911 - related issue
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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
meanssynchronous
, 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
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
meanssynchronous
, 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
Attributes
- Inherited from:
- Monad3
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Inherited from:
- Applicative3
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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 expressionF.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
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
Attributes
- Inherited from:
- Monad3
Attributes
- Inherited from:
- Applicative3
Attributes
- Inherited from:
- Monad3
Attributes
- Inherited from:
- Applicative3
Attributes
- Inherited from:
- Functor3
Attributes
- Inherited from:
- Bifunctor3
Attributes
- Inherited from:
- Bifunctor3
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
Attributes
- Definition Classes
- Inherited from:
- AsyncZio
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, 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 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, combining their results with the specified f
function. If
either side fails, then the other side will be interrupted.