object UIO extends ZIOFunctions
- Alphabetic
- By Inheritance
- UIO
- ZIOFunctions
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
_1[R >: LowerR, E <: UpperE, A, B](implicit ev: <:<[R, (A, B)]): ZIO[R, E, A]
Returns an effectful function that extracts out the first element of a tuple.
Returns an effectful function that extracts out the first element of a tuple.
- Definition Classes
- ZIOFunctions
-
final
def
_2[R >: LowerR, E <: UpperE, A, B](implicit ev: <:<[R, (A, B)]): ZIO[R, E, B]
Returns an effectful function that extracts out the second element of a tuple.
Returns an effectful function that extracts out the second element of a tuple.
- Definition Classes
- ZIOFunctions
-
final
def
absolve[R >: LowerR, E <: UpperE, A](v: ZIO[R, E, Either[E, A]]): ZIO[R, E, A]
Submerges the error case of an
Either
into theZIO
.Submerges the error case of an
Either
into theZIO
. The inverse operation ofIO.either
.- Definition Classes
- ZIOFunctions
-
final
def
access[R >: LowerR]: AccessPartiallyApplied[R]
Accesses the environment of the effect.
Accesses the environment of the effect.
val portNumber = effect.access(_.config.portNumber)
- Definition Classes
- ZIOFunctions
-
final
def
accessM[R >: LowerR]: AccessMPartiallyApplied[R]
Effectfully accesses the environment of the effect.
Effectfully accesses the environment of the effect.
- Definition Classes
- ZIOFunctions
-
final
def
allowInterrupt: UIO[Unit]
Makes an explicit check to see if the fiber has been interrupted, and if so, performs self-interruption.
Makes an explicit check to see if the fiber has been interrupted, and if so, performs self-interruption.
- Definition Classes
- ZIOFunctions
- def apply[A](a: ⇒ A): UIO[A]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
bracket[R >: LowerR, E <: UpperE, A, B](acquire: ZIO[R, E, A], release: (A) ⇒ ZIO[R, Nothing, _], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]
Uncurried version.
Uncurried version. Doesn't offer curried syntax and have worse type-inference characteristics, but guarantees no extra allocations of intermediate zio.ZIO.BracketAcquire and zio.ZIO.BracketRelease objects.
- Definition Classes
- ZIOFunctions
-
final
def
bracket[R >: LowerR, E <: UpperE, A](acquire: ZIO[R, E, A]): BracketAcquire[R, E, A]
When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.),
bracket
can be used to ensure the acquisition is not interrupted and the resource is always released.When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.),
bracket
can be used to ensure the acquisition is not interrupted and the resource is always released.The function does two things:
1. Ensures this effect, which acquires the resource, will not be interrupted. Of course, acquisition may fail for internal reasons (an uncaught exception). 2. Ensures the
release
effect will not be interrupted, and will be executed so long as this effect successfully acquires the resource.In between acquisition and release of the resource, the
use
effect is executed.If the
release
effect fails, then the entire effect will fail even if theuse
effect succeeds. If this fail-fast behavior is not desired, errors produced by therelease
effect can be caught and ignored.openFile("data.json").bracket(closeFile) { file => for { header <- readHeader(file) ... } yield result }
- Definition Classes
- ZIOFunctions
-
final
def
bracketExit[R >: LowerR, E <: UpperE, A, B](acquire: ZIO[R, E, A], release: (A, Exit[E, B]) ⇒ ZIO[R, Nothing, _], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]
Uncurried version.
Uncurried version. Doesn't offer curried syntax and have worse type-inference characteristics, but guarantees no extra allocations of intermediate zio.ZIO.BracketExitAcquire and zio.ZIO.BracketExitRelease objects.
- Definition Classes
- ZIOFunctions
-
final
def
bracketExit[R >: LowerR, E <: UpperE, A](acquire: ZIO[R, E, A]): BracketExitAcquire[R, E, A]
Acquires a resource, uses the resource, and then releases the resource.
Acquires a resource, uses the resource, and then releases the resource. Neither the acquisition nor the release will be interrupted, and the resource is guaranteed to be released, so long as the
acquire
effect succeeds. Ifuse
fails, then after release, the returned effect will fail with the same error.- Definition Classes
- ZIOFunctions
-
final
def
checkInterruptible[R >: LowerR, E <: UpperE, A](f: (InterruptStatus) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Checks the interrupt status, and produces the effect returned by the specified callback.
Checks the interrupt status, and produces the effect returned by the specified callback.
- Definition Classes
- ZIOFunctions
-
final
def
checkSupervised[R >: LowerR, E <: UpperE, A](f: (SuperviseStatus) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Checks supervision status.
Checks supervision status.
- Definition Classes
- ZIOFunctions
-
final
def
checkTraced[R >: LowerR, E <: UpperE, A](f: (TracingStatus) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Checks the ZIO Tracing status, and produces the effect returned by the specified callback.
Checks the ZIO Tracing status, and produces the effect returned by the specified callback.
- Definition Classes
- ZIOFunctions
-
final
def
children: UIO[IndexedSeq[Fiber[_, _]]]
Provides access to the list of child fibers supervised by this fiber.
Provides access to the list of child fibers supervised by this fiber.
Note: supervision must be enabled (via ZIO#supervised) on the current fiber for this operation to return non-empty lists.
- Definition Classes
- ZIOFunctions
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
collectAll[R >: LowerR, E <: UpperE, A](in: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]
Evaluate each effect in the structure from left to right, and collect the results.
Evaluate each effect in the structure from left to right, and collect the results. For a parallel version, see
collectAllPar
.- Definition Classes
- ZIOFunctions
-
final
def
collectAllPar[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]
Evaluate each effect in the structure in parallel, and collect the results.
Evaluate each effect in the structure in parallel, and collect the results. For a sequential version, see
collectAll
.- Definition Classes
- ZIOFunctions
-
final
def
collectAllParN[R >: LowerR, E <: UpperE, A](n: Long)(as: Iterable[ZIO[R, E, A]]): ZIO[R, E, List[A]]
Evaluate each effect in the structure in parallel, and collect the results.
Evaluate each effect in the structure in parallel, and collect the results. For a sequential version, see
collectAll
.Unlike
foreachAllPar
, this method will use at mostn
fibers.- Definition Classes
- ZIOFunctions
-
final
def
descriptor: UIO[Descriptor]
Returns information about the current fiber, such as its identity.
Returns information about the current fiber, such as its identity.
- Definition Classes
- ZIOFunctions
-
final
def
descriptorWith[R >: LowerR, E <: UpperE, A](f: (Descriptor) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Constructs an effect based on information about the current fiber, such as its identity.
Constructs an effect based on information about the current fiber, such as its identity.
- Definition Classes
- ZIOFunctions
-
final
def
die(t: Throwable): UIO[Nothing]
Returns an effect that dies with the specified
Throwable
.Returns an effect that dies with the specified
Throwable
. This method can be used for terminating a fiber because a defect has been detected in the code.- Definition Classes
- ZIOFunctions
-
final
def
dieMessage(message: String): UIO[Nothing]
Returns an effect that dies with a java.lang.RuntimeException having the specified text message.
Returns an effect that dies with a java.lang.RuntimeException having the specified text message. This method can be used for terminating a fiber because a defect has been detected in the code.
- Definition Classes
- ZIOFunctions
-
final
def
done[E <: UpperE, A](r: Exit[E, A]): IO[E, A]
Returns an effect from a zio.Exit value.
Returns an effect from a zio.Exit value.
- Definition Classes
- ZIOFunctions
-
final
def
effectAsync[R >: LowerR, E <: UpperE, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Unit): ZIO[R, E, A]
Imports an asynchronous effect into a pure
ZIO
value.Imports an asynchronous effect into a pure
ZIO
value. SeeeffectAsyncMaybe
for the more expressive variant of this function that can return a value synchronously.- Definition Classes
- ZIOFunctions
-
final
def
effectAsyncInterrupt[R >: LowerR, E <: UpperE, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Either[Canceler, ZIO[R, E, A]]): ZIO[R, E, A]
Imports an asynchronous effect into a pure
IO
value.Imports an asynchronous effect into a pure
IO
value. The effect has the option of returning the value synchronously, which is useful in cases where it cannot be determined if the effect is synchronous or asynchronous until the effect is actually executed. The effect also has the option of returning a canceler, which will be used by the runtime to cancel the asynchronous effect if the fiber executing the effect is interrupted.- Definition Classes
- ZIOFunctions
-
final
def
effectAsyncM[R >: LowerR, E <: UpperE, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ ZIO[R, E, _]): ZIO[R, E, A]
Imports an asynchronous effect into a pure
ZIO
value.Imports an asynchronous effect into a pure
ZIO
value. This formulation is necessary when the effect is itself expressed in terms ofZIO
.- Definition Classes
- ZIOFunctions
-
final
def
effectAsyncMaybe[R >: LowerR, E <: UpperE, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Option[ZIO[R, E, A]]): ZIO[R, E, A]
Imports an asynchronous effect into a pure
ZIO
value, possibly returning the value synchronously.Imports an asynchronous effect into a pure
ZIO
value, possibly returning the value synchronously.- Definition Classes
- ZIOFunctions
-
final
def
effectTotal[A](effect: ⇒ A): UIO[A]
Imports a total synchronous effect into a pure
ZIO
value.Imports a total synchronous effect into a pure
ZIO
value. The effect must not throw any exceptions. If you wonder if the effect throws exceptions, then do not use this method, use Task.effect, IO.effect, or ZIO.effect.val nanoTime: UIO[Long] = IO.effectTotal(System.nanoTime())
- Definition Classes
- ZIOFunctions
-
final
def
environment[R >: LowerR]: ZIO[R, Nothing, R]
Accesses the whole environment of the effect.
Accesses the whole environment of the effect.
- Definition Classes
- ZIOFunctions
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
fail[E <: UpperE](error: E): IO[E, Nothing]
Returns an effect that models failure with the specified error.
Returns an effect that models failure with the specified error. The moral equivalent of
throw
for pure code.- Definition Classes
- ZIOFunctions
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
flatten[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, ZIO[R, E, A]]): ZIO[R, E, A]
Returns an effect that first executes the outer effect, and then executes the inner effect, returning the value from the inner effect, and effectively flattening a nested effect.
Returns an effect that first executes the outer effect, and then executes the inner effect, returning the value from the inner effect, and effectively flattening a nested effect.
- Definition Classes
- ZIOFunctions
-
final
def
foldLeft[R >: LowerR, E <: UpperE, S, A](in: Iterable[A])(zero: S)(f: (S, A) ⇒ ZIO[R, E, S]): ZIO[R, E, S]
Folds an
Iterable[A]
using an effectful functionf
, working sequentially.Folds an
Iterable[A]
using an effectful functionf
, working sequentially.- Definition Classes
- ZIOFunctions
-
final
def
foreach[R >: LowerR, E <: UpperE, A, B](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]
Applies the function
f
to each element of theIterable[A]
and returns the results in a newList[B]
.Applies the function
f
to each element of theIterable[A]
and returns the results in a newList[B]
.For a parallel version of this method, see
foreachPar
.- Definition Classes
- ZIOFunctions
-
final
def
foreachPar[R >: LowerR, E <: UpperE, A, B](as: Iterable[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]
Applies the function
f
to each element of theIterable[A]
in parallel, and returns the results in a newList[B]
.Applies the function
f
to each element of theIterable[A]
in parallel, and returns the results in a newList[B]
.For a sequential version of this method, see
foreach
.- Definition Classes
- ZIOFunctions
-
final
def
foreachParN[R >: LowerR, E <: UpperE, A, B](n: Long)(as: Iterable[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, List[B]]
Applies the function
f
to each element of theIterable[A]
in parallel, and returns the results in a newList[B]
.Applies the function
f
to each element of theIterable[A]
in parallel, and returns the results in a newList[B]
.Unlike
foreachPar
, this method will use at most up ton
fibers.- Definition Classes
- ZIOFunctions
-
final
def
foreachParN_[R >: LowerR, E <: UpperE, A](n: Long)(as: Iterable[A])(f: (A) ⇒ ZIO[R, E, _]): ZIO[R, E, Unit]
Applies the function
f
to each element of theIterable[A]
and runs produced effects in parallel, discarding the results.Applies the function
f
to each element of theIterable[A]
and runs produced effects in parallel, discarding the results.Unlike
foreachPar_
, this method will use at most up ton
fibers.- Definition Classes
- ZIOFunctions
-
final
def
foreachPar_[R >: LowerR, E <: UpperE, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, _]): ZIO[R, E, Unit]
Applies the function
f
to each element of theIterable[A]
and runs produced effects in parallel, discarding the results.Applies the function
f
to each element of theIterable[A]
and runs produced effects in parallel, discarding the results.For a sequential version of this method, see
foreach_
.- Definition Classes
- ZIOFunctions
-
final
def
foreach_[R >: LowerR, E <: UpperE, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, _]): ZIO[R, E, Unit]
Applies the function
f
to each element of theIterable[A]
and runs produced effects sequentially.Applies the function
f
to each element of theIterable[A]
and runs produced effects sequentially.Equivalent to
foreach(as)(f).void
, but without the cost of building the list of results.- Definition Classes
- ZIOFunctions
-
final
def
forkAll[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, Nothing, Fiber[E, List[A]]]
Returns an effect that forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.
Returns an effect that forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.
- Definition Classes
- ZIOFunctions
-
final
def
forkAll_[R >: LowerR, E <: UpperE, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, Nothing, Unit]
Returns an effect that forks all of the specified values, and returns a composite fiber that produces unit.
Returns an effect that forks all of the specified values, and returns a composite fiber that produces unit. This version is faster than forkAll in cases where the results of the forked fibers are not needed.
- Definition Classes
- ZIOFunctions
-
final
def
fromEither[E <: UpperE, A](v: ⇒ Either[E, A]): IO[E, A]
Lifts an
Either
into aZIO
value.Lifts an
Either
into aZIO
value.- Definition Classes
- ZIOFunctions
-
final
def
fromFiber[E <: UpperE, A](fiber: ⇒ Fiber[E, A]): IO[E, A]
Creates a
ZIO
value that represents the exit value of the specified fiber.Creates a
ZIO
value that represents the exit value of the specified fiber.- Definition Classes
- ZIOFunctions
-
final
def
fromFiberM[E <: UpperE, A](fiber: IO[E, Fiber[E, A]]): IO[E, A]
Creates a
ZIO
value that represents the exit value of the specified fiber.Creates a
ZIO
value that represents the exit value of the specified fiber.- Definition Classes
- ZIOFunctions
-
final
def
fromFunction[R >: LowerR, A](f: (R) ⇒ A): ZIO[R, Nothing, A]
Lifts a function
R => A
into aZIO[R, Nothing, A]
.Lifts a function
R => A
into aZIO[R, Nothing, A]
.- Definition Classes
- ZIOFunctions
-
final
def
fromFunctionM[R >: LowerR, E, A](f: (R) ⇒ IO[E, A]): ZIO[R, E, A]
Lifts an effectful function whose effect requires no environment into an effect that requires the input to the function.
Lifts an effectful function whose effect requires no environment into an effect that requires the input to the function.
- Definition Classes
- ZIOFunctions
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
halt[E <: UpperE](cause: Cause[E]): IO[E, Nothing]
Returns an effect that models failure with the specified
Cause
.Returns an effect that models failure with the specified
Cause
.- Definition Classes
- ZIOFunctions
-
final
def
haltWith[E <: UpperE](function: (() ⇒ ZTrace) ⇒ Cause[E]): IO[E, Nothing]
Returns an effect that models failure with the specified
Cause
.Returns an effect that models failure with the specified
Cause
.This version takes in a lazily-evaluated trace that can be attached to the
Cause
viaCause.Traced
.- Definition Classes
- ZIOFunctions
-
final
def
handleChildrenWith[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A])(supervisor: (IndexedSeq[Fiber[_, _]]) ⇒ ZIO[R, Nothing, _]): ZIO[R, E, A]
Returns an effect that supervises the specified effect, ensuring that all fibers that it forks are passed to the specified supervisor as soon as the supervised effect completes.
Returns an effect that supervises the specified effect, ensuring that all fibers that it forks are passed to the specified supervisor as soon as the supervised effect completes.
- Definition Classes
- ZIOFunctions
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
identity[R >: LowerR]: ZIO[R, Nothing, R]
Returns the identity effectful function, which performs no effects
Returns the identity effectful function, which performs no effects
- Definition Classes
- ZIOFunctions
-
final
val
interrupt: UIO[Nothing]
Returns an effect that is interrupted.
Returns an effect that is interrupted.
- Definition Classes
- ZIOFunctions
-
final
def
interruptChildren[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Returns a new effect that ensures that any fibers that are forked by the effect are interrupted when this effect completes.
Returns a new effect that ensures that any fibers that are forked by the effect are interrupted when this effect completes.
- Definition Classes
- ZIOFunctions
-
final
def
interruptible[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Prefix form of
ZIO#interruptible
.Prefix form of
ZIO#interruptible
.- Definition Classes
- ZIOFunctions
-
final
def
interruptibleMask[R >: LowerR, E <: UpperE, A](k: (InterruptStatusRestore) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Makes the effect interruptible, but passes it a restore function that can be used to restore the inherited interruptibility from whatever region the effect is composed into.
Makes the effect interruptible, but passes it a restore function that can be used to restore the inherited interruptibility from whatever region the effect is composed into.
- Definition Classes
- ZIOFunctions
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
lock[R >: LowerR, E <: UpperE, A](executor: Executor)(zio: ZIO[R, E, A]): ZIO[R, E, A]
Returns an effect that will execute the specified effect fully on the provided executor, before returning to the default executor.
Returns an effect that will execute the specified effect fully on the provided executor, before returning to the default executor.
- Definition Classes
- ZIOFunctions
-
final
def
mergeAll[R >: LowerR, E <: UpperE, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]
Merges an
Iterable[IO]
to a single IO, working sequentially.Merges an
Iterable[IO]
to a single IO, working sequentially.- Definition Classes
- ZIOFunctions
-
final
def
mergeAllPar[R >: LowerR, E <: UpperE, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]
Merges an
Iterable[IO]
to a single IO, working in parallel.Merges an
Iterable[IO]
to a single IO, working in parallel.- Definition Classes
- ZIOFunctions
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
val
never: UIO[Nothing]
Returns a effect that will never produce anything.
Returns a effect that will never produce anything. The moral equivalent of
while(true) {}
, only without the wasted CPU cycles.- Definition Classes
- ZIOFunctions
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
provide[R >: LowerR, E <: UpperE, A](r: R): (ZIO[R, E, A]) ⇒ IO[E, A]
Given an environment
R
, returns a function that can supply the environment to programs that require it, removing their need for any specific environment.Given an environment
R
, returns a function that can supply the environment to programs that require it, removing their need for any specific environment.This is similar to dependency injection, and the
provide
function can be thought of asinject
.- Definition Classes
- ZIOFunctions
-
final
def
raceAll[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](zio: ZIO[R, E, A], ios: Iterable[ZIO[R1, E, A]]): ZIO[R1, E, A]
Races an
IO[E, A]
against zero or more other effects.Races an
IO[E, A]
against zero or more other effects. Yields either the first success or the last failure.- Definition Classes
- ZIOFunctions
-
final
def
reduceAll[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]
Reduces an
Iterable[IO]
to a singleIO
, working sequentially.Reduces an
Iterable[IO]
to a singleIO
, working sequentially.- Definition Classes
- ZIOFunctions
-
final
def
reduceAllPar[R >: LowerR, R1 >: LowerR <: R, E <: UpperE, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]
Reduces an
Iterable[IO]
to a singleIO
, working in parallel.Reduces an
Iterable[IO]
to a singleIO
, working in parallel.- Definition Classes
- ZIOFunctions
-
final
def
require[E <: UpperE, A](error: E): (IO[E, Option[A]]) ⇒ IO[E, A]
Requires that the given
IO[E, Option[A]]
contain a value.Requires that the given
IO[E, Option[A]]
contain a value. If there is no value, then the specified error will be raised.- Definition Classes
- ZIOFunctions
-
final
def
reserve[R, E, A, B](reservation: ZIO[R, E, Reservation[R, E, A]])(use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]
Acquires a resource, uses the resource, and then releases the resource.
Acquires a resource, uses the resource, and then releases the resource. However, unlike
bracket
, the separation of these phases allows the acquisition to be interruptible.Useful for concurrent data structures and other cases where the 'deallocator' can tell if the allocation succeeded or not just by inspecting internal / external state.
- Definition Classes
- ZIOFunctions
-
final
def
runtime[R >: LowerR]: ZIO[R, Nothing, Runtime[R]]
Returns an effect that accesses the runtime, which can be used to (unsafely) execute tasks.
Returns an effect that accesses the runtime, which can be used to (unsafely) execute tasks. This is useful for integration with non-functional code that must call back into functional code.
- Definition Classes
- ZIOFunctions
-
final
def
succeed[A](a: A): UIO[A]
Returns an effect that models success with the specified strictly- evaluated value.
Returns an effect that models success with the specified strictly- evaluated value.
- Definition Classes
- ZIOFunctions
-
final
def
succeedLazy[A](a: ⇒ A): UIO[A]
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, andZIO.effect
for capturing partial effects.- Definition Classes
- ZIOFunctions
-
final
def
superviseStatus[R >: LowerR, E <: UpperE, A](status: SuperviseStatus)(zio: ZIO[R, E, A]): ZIO[R, E, A]
Returns a new effect that has the same effects as this one, but with the supervision status changed as specified.
Returns a new effect that has the same effects as this one, but with the supervision status changed as specified.
- Definition Classes
- ZIOFunctions
-
final
def
supervised[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Enables supervision for this effect.
Enables supervision for this effect. This will cause fibers forked by this effect to be tracked and will enable their inspection via ZIO.children.
- Definition Classes
- ZIOFunctions
-
final
def
suspend[R >: LowerR, E <: UpperE, A](io: ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Returns a lazily constructed effect, whose construction may itself require effects.
Returns a lazily constructed effect, whose construction may itself require effects. This is a shortcut for
flatten(effectTotal(io))
.- Definition Classes
- ZIOFunctions
-
final
def
suspendWith[R >: LowerR, E <: UpperE, A](io: (Platform) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Returns a lazily constructed effect, whose construction may itself require effects.
Returns a lazily constructed effect, whose construction may itself require effects. This is a shortcut for
flatten(effectTotal(io))
.- Definition Classes
- ZIOFunctions
-
final
def
swap[R >: LowerR, E <: UpperE, A, B](implicit ev: <:<[R, (A, B)]): ZIO[R, E, (B, A)]
Returns an effectful function that merely swaps the elements in a
Tuple2
.Returns an effectful function that merely swaps the elements in a
Tuple2
.- Definition Classes
- ZIOFunctions
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
trace: UIO[ZTrace]
Capture ZIO trace at the current point
Capture ZIO trace at the current point
- Definition Classes
- ZIOFunctions
-
final
def
traced[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Prefix form of
ZIO#traced
.Prefix form of
ZIO#traced
.- Definition Classes
- ZIOFunctions
-
final
def
uninterruptible[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Prefix form of
ZIO#uninterruptible
.Prefix form of
ZIO#uninterruptible
.- Definition Classes
- ZIOFunctions
-
final
def
uninterruptibleMask[R >: LowerR, E <: UpperE, A](k: (InterruptStatusRestore) ⇒ ZIO[R, E, A]): ZIO[R, E, A]
Makes the effect uninterruptible, but passes it a restore function that can be used to restore the inherited interruptibility from whatever region the effect is composed into.
Makes the effect uninterruptible, but passes it a restore function that can be used to restore the inherited interruptibility from whatever region the effect is composed into.
- Definition Classes
- ZIOFunctions
-
final
val
unit: ZIO[Any, Nothing, Unit]
Strictly-evaluated unit lifted into the
ZIO
monad.Strictly-evaluated unit lifted into the
ZIO
monad.- Definition Classes
- ZIOFunctions
-
final
def
unsandbox[R >: LowerR, E <: UpperE, A](v: ZIO[R, Cause[E], A]): ZIO[R, E, A]
The inverse operation
IO.sandboxed
The inverse operation
IO.sandboxed
Terminates with exceptions on the
Left
side of theEither
error, if it exists. Otherwise extracts the containedIO[E, A]
- Definition Classes
- ZIOFunctions
-
final
def
unsupervised[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Disables supervision for this effect.
Disables supervision for this effect. This will cause fibers forked by this effect to not be tracked or appear in the list returned by ZIO.children.
- Definition Classes
- ZIOFunctions
-
final
def
untraced[R >: LowerR, E <: UpperE, A](zio: ZIO[R, E, A]): ZIO[R, E, A]
Prefix form of
ZIO#untraced
.Prefix form of
ZIO#untraced
.- Definition Classes
- ZIOFunctions
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
when[R >: LowerR, E <: UpperE](b: Boolean)(zio: ZIO[R, E, _]): ZIO[R, E, Unit]
The moral equivalent of
if (p) exp
The moral equivalent of
if (p) exp
- Definition Classes
- ZIOFunctions
-
final
def
whenM[R >: LowerR, E <: UpperE](b: ZIO[R, E, Boolean])(zio: ZIO[R, E, _]): ZIO[R, E, Unit]
The moral equivalent of
if (p) exp
whenp
has side-effectsThe moral equivalent of
if (p) exp
whenp
has side-effects- Definition Classes
- ZIOFunctions
-
final
val
yieldNow: UIO[Unit]
Returns an effect that yields to the runtime system, starting on a fresh stack.
Returns an effect that yields to the runtime system, starting on a fresh stack. Manual use of this method can improve fairness, at the cost of overhead.
- Definition Classes
- ZIOFunctions