Object/Trait

zio

ZIO

Related Docs: trait ZIO | package zio

Permalink

object ZIO extends ZIOCompanionPlatformSpecific with Serializable

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

Type Members

  1. final class AccessPartiallyApplied[R] extends AnyVal

    Permalink
  2. final class AccessZIOPartiallyApplied[R] extends AnyVal

    Permalink
  3. final class BracketAcquire[-R, +E, +A] extends AnyVal

    Permalink
  4. final class BracketAcquire_[-R, +E] extends AnyVal

    Permalink
  5. final class BracketExitAcquire[-R, +E, +A] extends AnyVal

    Permalink
  6. final class BracketExitRelease[-R, +E, E1, +A, B] extends AnyRef

    Permalink
  7. final class BracketRelease[-R, +E, +A] extends AnyRef

    Permalink
  8. final class BracketReleaseFn[R, E, A, B] extends ZIOFn2[A, Exit[E, B], URIO[R, Any]]

    Permalink
  9. final class BracketRelease_[-R, +E] extends AnyRef

    Permalink
  10. abstract class CanFilter[+E] extends AnyRef

    Permalink
    Annotations
    @implicitNotFound( ... )
  11. final class ConstFn[A, B] extends ZIOFn1[A, B]

    Permalink
  12. final class ConstZIOFn[R, E, A, B] extends ZIOFn1[A, ZIO[R, E, B]]

    Permalink
  13. final class FoldCauseZIOFailureFn[R, E, E2, A] extends ZIOFn1[Cause[E], ZIO[R, E2, A]]

    Permalink
  14. final class FoldCauseZIOFailureTraceFn[R, E, E2, A] extends ZIOFn1[Cause[E], ZIO[R, E2, A]]

    Permalink
  15. final class ForkScopeRestore extends AnyVal

    Permalink
  16. final class GetStateWithPartiallyApplied[S] extends AnyVal

    Permalink
  17. final class Grafter extends AnyVal

    Permalink
  18. final class IfZIO[R, E] extends AnyVal

    Permalink
  19. final class InterruptStatusRestore extends AnyVal

    Permalink
  20. final class MapErrorCauseFn[R, E, E2, A] extends ZIOFn1[Cause[E], ZIO[R, E2, Nothing]]

    Permalink
  21. final class MapErrorFn[R, E, E2, A] extends ZIOFn1[Cause[E], ZIO[R, E2, Nothing]]

    Permalink
  22. final class MapFn[R, E, A, B] extends ZIOFn1[A, ZIO[R, E, B]]

    Permalink
  23. final class ProvideSomeLayer[R0, -R, +E, +A] extends AnyVal

    Permalink
  24. final class ServiceWithPartiallyApplied[Service] extends AnyVal

    Permalink
  25. final class SucceedFn[R, E, A] extends ZIOFn1[A, ZIO[R, E, A]]

    Permalink
  26. final class TapCauseRefailFn[R, E, E1 >: E, A] extends ZIOFn1[Cause[E], ZIO[R, E1, Nothing]]

    Permalink
  27. final class TapDefectRefailFn[R, E, E1 >: E] extends ZIOFn1[Cause[E], ZIO[R, E1, Nothing]]

    Permalink
  28. final class TapErrorRefailFn[R, E, E1 >: E, A] extends ZIOFn1[Cause[E], ZIO[R, E1, Nothing]]

    Permalink
  29. final class TapErrorTraceRefailFn[R, E, E1 >: E, A] extends ZIOFn1[Cause[E], ZIO[R, E1, Nothing]]

    Permalink
  30. final class TapFn[R, E, A] extends ZIOFn1[A, ZIO[R, E, A]]

    Permalink
  31. final class TimeoutTo[-R, +E, +A, +B] extends AnyRef

    Permalink
  32. final class UnlessZIO[R, E] extends AnyVal

    Permalink
  33. final class UpdateService[-R, +E, +A, M] extends AnyVal

    Permalink
  34. final class WhenZIO[R, E] extends AnyVal

    Permalink
  35. implicit final class ZIOAutoCloseableOps[R, E, A <: AutoCloseable] extends AnyVal

    Permalink
  36. sealed trait ZIOConstructor[-Environment, +Error, In] extends AnyRef

    Permalink

    A ZIOConstructor[Input] knows how to construct a ZIO value from an input of type Input.

    A ZIOConstructor[Input] knows how to construct a ZIO value from an input of type Input. This allows the type of the ZIO value constructed to depend on Input. The constructed ZIO value is guaranteed not to require any services not included in Environment or to be able to fail in any ways not described by Error.

  37. trait ZIOConstructorLowPriority1 extends ZIOConstructorLowPriority2

    Permalink
  38. trait ZIOConstructorLowPriority2 extends ZIOConstructorLowPriority3

    Permalink
  39. trait ZIOConstructorLowPriority3 extends AnyRef

    Permalink
  40. implicit final class ZIOWithFilterOps[R, E, A] extends AnyVal

    Permalink
  41. implicit final class ZioRefineToOrDieOps[R, E <: Throwable, A] extends AnyVal

    Permalink
  42. final class ZipLeftFn[R, E, A, B] extends ZIOFn1[B, ZIO[R, E, B]]

    Permalink
  43. final class ZipRightFn[R, E, A, B] extends ZIOFn1[A, ZIO[R, E, B]]

    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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object CanFilter

    Permalink
  5. object InterruptStatusRestore

    Permalink
  6. object ZIOConstructor extends ZIOConstructorLowPriority1

    Permalink
  7. def absolve[R, E, A](v: ZIO[R, E, Either[E, A]]): ZIO[R, E, A]

    Permalink

    Submerges the error case of an Either into the ZIO.

    Submerges the error case of an Either into the ZIO. The inverse operation of IO.either.

  8. def access[R]: AccessPartiallyApplied[R]

    Permalink

    Accesses the environment of the effect.

    Accesses the environment of the effect.

    val portNumber = effect.access(_.config.portNumber)
  9. def accessZIO[R]: AccessZIOPartiallyApplied[R]

    Permalink

    Effectfully accesses the environment of the effect.

  10. def acquireReleaseExitWith[R, E, A, B](acquire: ZIO[R, E, A], release: (A, Exit[E, B]) ⇒ URIO[R, Any], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    Uncurried version.

    Uncurried version. Doesn't offer curried syntax and has worse type-inference characteristics, but guarantees no extra allocations of intermediate zio.ZIO.BracketExitAcquire and zio.ZIO.BracketExitRelease objects.

  11. def acquireReleaseExitWith[R, E, A](acquire: ZIO[R, E, A]): BracketExitAcquire[R, E, A]

    Permalink

    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. If use fails, then after release, the returned effect will fail with the same error.

  12. def acquireReleaseWith[R, E, A, B](acquire: ZIO[R, E, A], release: (A) ⇒ URIO[R, Any], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    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.

  13. def acquireReleaseWith[R, E, A](acquire: ZIO[R, E, A]): BracketAcquire[R, E, A]

    Permalink

    When this effect represents acquisition of a resource (for example, opening a file, launching a thread, etc.), acquireReleaseWith 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.), acquireReleaseWith 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 the use effect succeeds. If this fail-fast behavior is not desired, errors produced by the release effect can be caught and ignored.

    openFile("data.json").acquireReleaseWith(closeFile) { file =>
      for {
        header <- readHeader(file)
        ...
      } yield result
    }
  14. def allowInterrupt: UIO[Unit]

    Permalink

    Makes an explicit check to see if the fiber has been interrupted, and if so, performs self-interruption

  15. def apply[A](a: ⇒ A): Task[A]

    Permalink
  16. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  17. def async[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Any, blockingOn: Id = Fiber.Id.None): ZIO[R, E, A]

    Permalink

    Imports an asynchronous side-effect into a pure ZIO value.

    Imports an asynchronous side-effect into a pure ZIO value. See asyncMaybe for the more expressive variant of this function that can return a value synchronously.

    The callback function ZIO[R, E, A] => Any must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

  18. def asyncInterrupt[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Either[Canceler[R], ZIO[R, E, A]], blockingOn: Id = Fiber.Id.None): ZIO[R, E, A]

    Permalink

    Imports an asynchronous side-effect into a ZIO effect.

    Imports an asynchronous side-effect into a ZIO effect. The side-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 side-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.

    If the register function returns a value synchronously, then the callback function ZIO[R, E, A] => Any must not be called. Otherwise the callback function must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

  19. def asyncMaybe[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Option[ZIO[R, E, A]], blockingOn: Id = Fiber.Id.None): ZIO[R, E, A]

    Permalink

    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.

    If the register function returns a value synchronously, then the callback function ZIO[R, E, A] => Any must not be called. Otherwise the callback function must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

  20. def asyncWithCompletionHandler[T](op: (CompletionHandler[T, Any]) ⇒ Any): Task[T]

    Permalink
    Definition Classes
    ZIOCompanionPlatformSpecific
  21. def asyncZIO[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ ZIO[R, E, Any]): ZIO[R, E, A]

    Permalink

    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 of ZIO.

  22. def attempt[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous side-effect into a pure ZIO value, translating any thrown exceptions into typed failed effects creating with ZIO.fail.

    Imports a synchronous side-effect into a pure ZIO value, translating any thrown exceptions into typed failed effects creating with ZIO.fail.

    def printLine(line: String): Task[Unit] = Task.attempt(println(line))
  23. def attemptBlocking[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value.

  24. def attemptBlockingCancelable[A](effect: ⇒ A)(cancel: UIO[Unit]): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value, with a custom cancel effect.

    Imports a synchronous effect that does blocking IO into a pure value, with a custom cancel effect.

    If the returned ZIO is interrupted, the blocked thread running the synchronous effect will be interrupted via the cancel effect.

  25. def attemptBlockingIO[A](effect: ⇒ A): IO[IOException, A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value, refining the error type to java.io.IOException.

  26. def attemptBlockingInterrupt[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value.

    Imports a synchronous effect that does blocking IO into a pure value.

    If the returned ZIO is interrupted, the blocked thread running the synchronous effect will be interrupted via Thread.interrupt.

    Note that this adds significant overhead. For performance sensitive applications consider using attemptBlocking or attemptBlockingCancelable.

  27. def blocking[R, E, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Locks the specified effect to the blocking thread pool.

  28. def blockingExecutor: UIO[Executor]

    Permalink

    Retrieves the executor for all blocking tasks.

  29. def checkInterruptible[R, E, A](f: (zio.InterruptStatus) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Checks the interrupt status, and produces the effect returned by the specified callback.

  30. def checkTraced[R, E, A](f: (zio.TracingStatus) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Checks the ZIO Tracing status, and produces the effect returned by the specified callback.

  31. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def collect[R, E, Key, Key2, Value, Value2](map: Map[Key, Value])(f: (Key, Value) ⇒ ZIO[R, Option[E], (Key2, Value2)]): ZIO[R, E, Map[Key2, Value2]]

    Permalink

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases.

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases. For a parallel version, see collectPar.

  33. def collect[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, Option[E], B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases.

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases. For a parallel version, see collectPar.

  34. def collectAll[R, E, A](in: NonEmptyChunk[ZIO[R, E, A]]): ZIO[R, E, NonEmptyChunk[A]]

    Permalink

    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.

  35. def collectAll[R, E, A](in: Option[ZIO[R, E, A]]): ZIO[R, E, Option[A]]

    Permalink

    Evaluate effect if present, and return its result as Option[A].

  36. def collectAll[R, E, A](in: Array[ZIO[R, E, A]])(implicit arg0: ClassTag[A]): ZIO[R, E, Array[A]]

    Permalink

    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.

  37. def collectAll[R, E, A](in: Set[ZIO[R, E, A]]): ZIO[R, E, Set[A]]

    Permalink

    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.

  38. def collectAll[R, E, A, Collection[+Element] <: Iterable[Element]](in: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    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.

  39. def collectAllDiscard[R, E, A](in: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure from left to right, and discard the results.

    Evaluate each effect in the structure from left to right, and discard the results. For a parallel version, see collectAllParDiscard.

  40. def collectAllPar[R, E, A](as: NonEmptyChunk[ZIO[R, E, A]]): ZIO[R, E, NonEmptyChunk[A]]

    Permalink

    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.

  41. def collectAllPar[R, E, A](as: Array[ZIO[R, E, A]])(implicit arg0: ClassTag[A]): ZIO[R, E, Array[A]]

    Permalink

    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.

  42. def collectAllPar[R, E, A](as: Set[ZIO[R, E, A]]): ZIO[R, E, Set[A]]

    Permalink

    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.

  43. def collectAllPar[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    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.

  44. def collectAllParDiscard[R, E, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure in parallel, and discard the results.

    Evaluate each effect in the structure in parallel, and discard the results. For a sequential version, see collectAllDiscard.

  45. def collectAllParN[R, E, A, Collection[+Element] <: Iterable[Element]](n: Int)(as: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    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 collectAllPar, this method will use at most n fibers.

  46. def collectAllParNDiscard[R, E, A](n: Int)(as: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure in parallel, and discard the results.

    Evaluate each effect in the structure in parallel, and discard the results. For a sequential version, see collectAllDiscard.

    Unlike collectAllParDiscard, this method will use at most n fibers.

  47. def collectAllSuccesses[R, E, A, Collection[+Element] <: Iterable[Element]](in: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): URIO[R, Collection[A]]

    Permalink

    Evaluate and run each effect in the structure and collect discarding failed ones.

  48. def collectAllSuccessesPar[R, E, A, Collection[+Element] <: Iterable[Element]](in: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): URIO[R, Collection[A]]

    Permalink

    Evaluate and run each effect in the structure in parallel, and collect discarding failed ones.

  49. def collectAllSuccessesParN[R, E, A, Collection[+Element] <: Iterable[Element]](n: Int)(in: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): URIO[R, Collection[A]]

    Permalink

    Evaluate and run each effect in the structure in parallel, and collect discarding failed ones.

    Evaluate and run each effect in the structure in parallel, and collect discarding failed ones.

    Unlike collectAllSuccessesPar, this method will use at most up to n fibers.

  50. def collectAllWith[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[ZIO[R, E, A]])(f: PartialFunction[A, B])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Evaluate each effect in the structure with collectAll, and collect the results with given partial function.

  51. def collectAllWithPar[R, E, A, U, Collection[+Element] <: Iterable[Element]](in: Collection[ZIO[R, E, A]])(f: PartialFunction[A, U])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], U, Collection[U]]): ZIO[R, E, Collection[U]]

    Permalink

    Evaluate each effect in the structure with collectAllPar, and collect the results with given partial function.

  52. def collectAllWithParN[R, E, A, B, Collection[+Element] <: Iterable[Element]](n: Int)(in: Collection[ZIO[R, E, A]])(f: PartialFunction[A, B])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Evaluate each effect in the structure with collectAllPar, and collect the results with given partial function.

    Evaluate each effect in the structure with collectAllPar, and collect the results with given partial function.

    Unlike collectAllWithPar, this method will use at most up to n fibers.

  53. def collectFirst[R, E, A, B](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Option[B]]): ZIO[R, E, Option[B]]

    Permalink

    Collects the first element of the Iterable[A] for which the effectual function f returns Some.

  54. def collectPar[R, E, Key, Key2, Value, Value2](map: Map[Key, Value])(f: (Key, Value) ⇒ ZIO[R, Option[E], (Key2, Value2)]): ZIO[R, E, Map[Key2, Value2]]

    Permalink

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases.

    Evaluate each effect in the structure from left to right, collecting the the successful values and discarding the empty cases. For a parallel version, see collectPar.

  55. def collectPar[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, Option[E], B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Evaluate each effect in the structure in parallel, collecting the the successful values and discarding the empty cases.

  56. def collectParN[R, E, A, B, Collection[+Element] <: Iterable[Element]](n: Int)(in: Collection[A])(f: (A) ⇒ ZIO[R, Option[E], B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Evaluate each effect in the structure in parallel, collecting the the successful values and discarding the empty cases.

    Evaluate each effect in the structure in parallel, collecting the the successful values and discarding the empty cases.

    Unlike collectPar, this method will use at most up to n fibers.

  57. def cond[E, A](predicate: Boolean, result: ⇒ A, error: ⇒ E): IO[E, A]

    Permalink

    Similar to Either.cond, evaluate the predicate, return the given A as success if predicate returns true, and the given E as error otherwise

    Similar to Either.cond, evaluate the predicate, return the given A as success if predicate returns true, and the given E as error otherwise

    For effectful conditionals, see ZIO.ifZIO

  58. def debug(value: ⇒ Any): UIO[Unit]

    Permalink

    Prints the specified message to the console for debugging purposes.

  59. def descriptor: UIO[Fiber.Descriptor]

    Permalink

    Returns information about the current fiber, such as its identity.

  60. def descriptorWith[R, E, A](f: (Fiber.Descriptor) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Constructs an effect based on information about the current fiber, such as its identity.

  61. def die(t: ⇒ Throwable): UIO[Nothing]

    Permalink

    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.

  62. def dieMessage(message: ⇒ String): UIO[Nothing]

    Permalink

    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.

  63. def done[E, A](r: ⇒ Exit[E, A]): IO[E, A]

    Permalink

    Returns an effect from a zio.Exit value.

  64. def effectTotalWith[A](effect: (Platform, Id) ⇒ A): UIO[A]

    Permalink

    The same as ZIO.effectTotal, but also provides access to the underlying Platform and fiber id.

  65. def environment[R]: URIO[R, R]

    Permalink

    Accesses the whole environment of the effect.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  68. def executor: UIO[Executor]

    Permalink

    Retrieves the executor for this effect.

  69. def exists[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Boolean]

    Permalink

    Determines whether any element of the Iterable[A] satisfies the effectual predicate f.

  70. def fail[E](error: ⇒ E): IO[E, Nothing]

    Permalink

    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.

  71. def failCause[E](cause: ⇒ Cause[E]): IO[E, Nothing]

    Permalink

    Returns an effect that models failure with the specified Cause.

  72. def failCauseWith[E](function: (() ⇒ ZTrace) ⇒ Cause[E]): IO[E, Nothing]

    Permalink

    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 via Cause.Traced.

  73. val fiberId: UIO[Id]

    Permalink

    Returns the Fiber.Id of the fiber executing the effect that calls this method.

  74. def filter[R, E, A](as: Set[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Set[A]]

    Permalink

    Filters the Set[A] using the specified effectual predicate.

  75. def filter[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZIO[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    Filters the collection using the specified effectual predicate.

  76. def filterNot[R, E, A](as: Set[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Set[A]]

    Permalink

    Filters the Set[A] using the specified effectual predicate, removing all elements that satisfy the predicate.

  77. def filterNot[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZIO[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    Filters the collection using the specified effectual predicate, removing all elements that satisfy the predicate.

  78. def filterNotPar[R, E, A](as: Set[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Set[A]]

    Permalink

    Filters the Set[A] in parallel using the specified effectual predicate, removing all elements that satisfy the predicate.

    Filters the Set[A] in parallel using the specified effectual predicate, removing all elements that satisfy the predicate.

    See zio.ZIO.filterNot[R,E,A](as:Set* for a sequential version.

  79. def filterNotPar[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZIO[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    Filters the collection in parallel using the specified effectual predicate, emoving all elements that satisfy the predicate.

    Filters the collection in parallel using the specified effectual predicate, emoving all elements that satisfy the predicate.

    See zio.ZIO.filterNot[R,E,A,Collection* for a sequential version.

  80. def filterPar[R, E, A](as: Set[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Set[A]]

    Permalink

    Filters the Set[A] in parallel using the specified effectual predicate.

    Filters the Set[A] in parallel using the specified effectual predicate.

    See zio.ZIO.filter[R,E,A,Collection* for a sequential version.

  81. def filterPar[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZIO[R, E, Boolean])(implicit bf: zio.BuildFrom[Collection[A], A, Collection[A]]): ZIO[R, E, Collection[A]]

    Permalink

    Filters the collection in parallel using the specified effectual predicate.

    Filters the collection in parallel using the specified effectual predicate.

    See zio.ZIO.filter[R,E,A,Collection* for a sequential version.

  82. def finalize(): Unit

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

    Permalink

    Returns an effect that runs the first effect and in case of failure, runs each of the specified effects in order until one of them succeeds.

  84. def flatten[R, E, A](zio: ZIO[R, E, ZIO[R, E, A]]): ZIO[R, E, A]

    Permalink

    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.

  85. def foldLeft[R, E, S, A](in: Iterable[A])(zero: S)(f: (S, A) ⇒ ZIO[R, E, S]): ZIO[R, E, S]

    Permalink

    Folds an Iterable[A] using an effectual function f, working sequentially from left to right.

  86. def foldRight[R, E, S, A](in: Iterable[A])(zero: S)(f: (A, S) ⇒ ZIO[R, E, S]): ZIO[R, E, S]

    Permalink

    Folds an Iterable[A] using an effectual function f, working sequentially from right to left.

  87. def forall[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Boolean]): ZIO[R, E, Boolean]

    Permalink

    Determines whether all elements of the Iterable[A] satisfy the effectual predicate f.

  88. final def foreach[R, E, A, B](in: NonEmptyChunk[A])(f: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, NonEmptyChunk[B]]

    Permalink

    Applies the function f to each element of the NonEmptyChunk[A] and returns the results in a new NonEmptyChunk[B].

    Applies the function f to each element of the NonEmptyChunk[A] and returns the results in a new NonEmptyChunk[B].

    For a parallel version of this method, see foreachPar. If you do not need the results, see foreachDiscard for a more efficient implementation.

  89. final def foreach[R, E, A, B](in: Option[A])(f: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, Option[B]]

    Permalink

    Applies the function f if the argument is non-empty and returns the results in a new Option[B].

  90. def foreach[R, E, Key, Key2, Value, Value2](map: Map[Key, Value])(f: (Key, Value) ⇒ ZIO[R, E, (Key2, Value2)]): ZIO[R, E, Map[Key2, Value2]]

    Permalink

    Applies the function f to each element of the Map[Key, Value] and returns the results in a new Map[Key2, Value2].

    Applies the function f to each element of the Map[Key, Value] and returns the results in a new Map[Key2, Value2].

    For a parallel version of this method, see foreachPar. If you do not need the results, see foreachDiscard for a more efficient implementation.

  91. final def foreach[R, E, A, B](in: Array[A])(f: (A) ⇒ ZIO[R, E, B])(implicit arg0: ClassTag[B]): ZIO[R, E, Array[B]]

    Permalink

    Applies the function f to each element of the Array[A] and returns the results in a new Array[B].

    Applies the function f to each element of the Array[A] and returns the results in a new Array[B].

    For a parallel version of this method, see foreachPar. If you do not need the results, see foreachDiscard for a more efficient implementation.

  92. final def foreach[R, E, A, B](in: Set[A])(f: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, Set[B]]

    Permalink

    Applies the function f to each element of the Set[A] and returns the results in a new Set[B].

    Applies the function f to each element of the Set[A] and returns the results in a new Set[B].

    For a parallel version of this method, see foreachPar. If you do not need the results, see foreachDiscard for a more efficient implementation.

  93. def foreach[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Applies the function f to each element of the Collection[A] and returns the results in a new Collection[B].

    Applies the function f to each element of the Collection[A] and returns the results in a new Collection[B].

    For a parallel version of this method, see foreachPar. If you do not need the results, see foreach_ for a more efficient implementation.

  94. def foreachDiscard[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects sequentially.

    Applies the function f to each element of the Iterable[A] and runs produced effects sequentially.

    Equivalent to foreach(as)(f).unit, but without the cost of building the list of results.

  95. final def foreachExec[R, E, A, B, Collection[+Element] <: Iterable[Element]](as: Collection[A])(exec: ExecutionStrategy)(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Applies the function f to each element of the Collection[A] and returns the result in a new Collection[B] using the specified execution strategy.

  96. final def foreachPar[R, E, A, B](as: NonEmptyChunk[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, NonEmptyChunk[B]]

    Permalink

    Applies the function f to each element of the NonEmptyChunk[A] in parallel, and returns the results in a new NonEmptyChunk[B].

    Applies the function f to each element of the NonEmptyChunk[A] in parallel, and returns the results in a new NonEmptyChunk[B].

    For a sequential version of this method, see foreach.

  97. def foreachPar[R, E, Key, Key2, Value, Value2](map: Map[Key, Value])(f: (Key, Value) ⇒ ZIO[R, E, (Key2, Value2)]): ZIO[R, E, Map[Key2, Value2]]

    Permalink

    Applies the function f to each element of the Map[Key, Value] in parallel and returns the results in a new Map[Key2, Value2].

    Applies the function f to each element of the Map[Key, Value] in parallel and returns the results in a new Map[Key2, Value2].

    For a sequential version of this method, see foreach.

  98. final def foreachPar[R, E, A, B](as: Array[A])(f: (A) ⇒ ZIO[R, E, B])(implicit arg0: ClassTag[B]): ZIO[R, E, Array[B]]

    Permalink

    Applies the function f to each element of the Array[A] in parallel, and returns the results in a new Array[B].

    Applies the function f to each element of the Array[A] in parallel, and returns the results in a new Array[B].

    For a sequential version of this method, see foreach.

  99. final def foreachPar[R, E, A, B](as: Set[A])(fn: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, Set[B]]

    Permalink

    Applies the function f to each element of the Set[A] in parallel, and returns the results in a new Set[B].

    Applies the function f to each element of the Set[A] in parallel, and returns the results in a new Set[B].

    For a sequential version of this method, see foreach.

  100. def foreachPar[R, E, A, B, Collection[+Element] <: Iterable[Element]](as: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Applies the function f to each element of the Collection[A] in parallel, and returns the results in a new Collection[B].

    Applies the function f to each element of the Collection[A] in parallel, and returns the results in a new Collection[B].

    For a sequential version of this method, see foreach.

  101. def foreachParDiscard[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    For a sequential version of this method, see foreachDiscard.

    Optimized to avoid keeping full tree of effects, so that method could be able to handle large input sequences. Behaves almost like this code:

    as.foldLeft(ZIO.unit) { (acc, a) => acc.zipParLeft(f(a)) }

    Additionally, interrupts all effects on any failure.

  102. def foreachParN[R, E, A, B, Collection[+Element] <: Iterable[Element]](n: Int)(as: Collection[A])(fn: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]]): ZIO[R, E, Collection[B]]

    Permalink

    Applies the function f to each element of the Collection[A] in parallel, and returns the results in a new Collection[B].

    Applies the function f to each element of the Collection[A] in parallel, and returns the results in a new Collection[B].

    Unlike foreachPar, this method will use at most up to n fibers.

  103. def foreachParNDiscard[R, E, A](n: Int)(as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Unlike foreachParDiscard, this method will use at most up to n fibers.

  104. def forkAll[R, E, A, Collection[+Element] <: Iterable[Element]](as: Collection[ZIO[R, E, A]])(implicit bf: zio.BuildFrom[Collection[ZIO[R, E, A]], A, Collection[A]]): URIO[R, Fiber[E, Collection[A]]]

    Permalink

    Returns an effect that forks all of the specified values, and returns a composite fiber that produces a list of their results, in order.

  105. def forkAllDiscard[R, E, A](as: Iterable[ZIO[R, E, A]]): URIO[R, Unit]

    Permalink

    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.

  106. def forkScope: UIO[ZScope[Exit[Any, Any]]]

    Permalink

    Retrieves the scope that will be used to supervise forked effects.

  107. def forkScopeMask[R, E, A](newScope: ZScope[Exit[Any, Any]])(f: (ForkScopeRestore) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Captures the fork scope, before overriding it with the specified new scope, passing a function that allows restoring the fork scope to what it was originally.

  108. def forkScopeWith[R, E, A](f: (ZScope[Exit[Any, Any]]) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Retrieves the scope that will be used to supervise forked effects.

  109. def from[Input](input: ⇒ Input)(implicit constructor: ZIOConstructor[Nothing, Any, Input]): ZIO[OutEnvironment, OutError, OutSuccess]

    Permalink

    Constructs a ZIO value of the appropriate type for the specified input.

  110. def fromCompletableFuture[A](cs: ⇒ CompletableFuture[A]): Task[A]

    Permalink

    Alias for formCompletionStage for a concrete implementation of CompletionStage

    Alias for formCompletionStage for a concrete implementation of CompletionStage

    Definition Classes
    ZIOCompanionPlatformSpecific
  111. def fromCompletionStage[A](cs: ⇒ CompletionStage[A]): Task[A]

    Permalink
    Definition Classes
    ZIOCompanionPlatformSpecific
  112. def fromEither[E, A](v: ⇒ Either[E, A]): IO[E, A]

    Permalink

    Lifts an Either into a ZIO value.

  113. def fromEitherCause[E, A](v: ⇒ Either[Cause[E], A]): IO[E, A]

    Permalink

    Lifts an Either into a ZIO value.

  114. def fromFiber[E, A](fiber: ⇒ Fiber[E, A]): IO[E, A]

    Permalink

    Creates a ZIO value that represents the exit value of the specified fiber.

  115. def fromFiberZIO[R, E, A](fiber: ZIO[R, E, Fiber[E, A]]): ZIO[R, E, A]

    Permalink

    Creates a ZIO value that represents the exit value of the specified fiber.

  116. def fromFuture[A](make: (ExecutionContext) ⇒ Future[A]): Task[A]

    Permalink

    Imports a function that creates a scala.concurrent.Future from an scala.concurrent.ExecutionContext into a ZIO.

  117. def fromFutureInterrupt[A](make: (ExecutionContext) ⇒ Future[A]): Task[A]

    Permalink

    Imports a function that creates a scala.concurrent.Future from an scala.concurrent.ExecutionContext into a ZIO.

    Imports a function that creates a scala.concurrent.Future from an scala.concurrent.ExecutionContext into a ZIO. The provided ExecutionContext will interrupt the Future between asynchronous operations such as map and flatMap if this effect is interrupted. Note that no attempt will be made to interrupt a Future blocking on a synchronous operation and that the Future must be created using the provided ExecutionContext.

  118. def fromFutureJava[A](future: ⇒ Future[A]): Task[A]

    Permalink

    WARNING: this uses the blocking Future#get, consider using fromCompletionStage

    WARNING: this uses the blocking Future#get, consider using fromCompletionStage

    Definition Classes
    ZIOCompanionPlatformSpecific
  119. def fromOption[A](v: ⇒ Option[A]): IO[Option[Nothing], A]

    Permalink

    Lifts an Option into a ZIO but preserves the error as an option in the error channel, making it easier to compose in some scenarios.

  120. def fromPromiseScala[A](promise: scala.concurrent.Promise[A]): Task[A]

    Permalink

    Imports a scala.concurrent.Promise we generate a future from promise, and we pass to [fromFuture] to transform into Task[A]

  121. def fromTry[A](value: ⇒ Try[A]): Task[A]

    Permalink

    Lifts a Try into a ZIO.

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

    Permalink
    Definition Classes
    AnyRef → Any
  123. final def getOrFail[A](v: ⇒ Option[A]): Task[A]

    Permalink

    Lifts an Option into a ZIO, if the option is not defined it fails with NoSuchElementException.

  124. final def getOrFailUnit[A](v: ⇒ Option[A]): IO[Unit, A]

    Permalink

    Lifts an Option into a IO, if the option is not defined it fails with Unit.

  125. final def getOrFailWith[E, A](e: ⇒ E)(v: ⇒ Option[A]): IO[E, A]

    Permalink

    Lifts an Option into a ZIO.

    Lifts an Option into a ZIO. If the option is not defined, fail with the e value.

  126. def getState[S](implicit arg0: zio.Tag[S]): ZIO[Has[ZState[S]], Nothing, S]

    Permalink

    Gets a state from the environment.

  127. def getStateWith[S]: GetStateWithPartiallyApplied[S]

    Permalink

    Gets a state from the environment and uses it to run the specified function.

  128. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  129. def ifZIO[R, E](b: ZIO[R, E, Boolean]): IfZIO[R, E]

    Permalink

    Runs onTrue if the result of b is true and onFalse otherwise.

  130. val infinity: URIO[Has[Clock], Nothing]

    Permalink

    Like never, but fibers that running this effect won't be garbage collected unless interrupted.

  131. lazy val interrupt: UIO[Nothing]

    Permalink

    Returns an effect that is interrupted as if by the fiber calling this method.

  132. def interruptAs(fiberId: ⇒ Id): UIO[Nothing]

    Permalink

    Returns an effect that is interrupted as if by the specified fiber.

  133. def interruptible[R, E, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Prefix form of ZIO#interruptible.

  134. def interruptibleMask[R, E, A](k: (InterruptStatusRestore) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    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.

  135. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  136. def iterate[R, E, S](initial: S)(cont: (S) ⇒ Boolean)(body: (S) ⇒ ZIO[R, E, S]): ZIO[R, E, S]

    Permalink

    Iterates with the specified effectual function.

    Iterates with the specified effectual function. The moral equivalent of:

    var s = initial
    
    while (cont(s)) {
      s = body(s)
    }
    
    s
  137. def left[A](a: ⇒ A): UIO[Either[A, Nothing]]

    Permalink

    Returns an effect with the value on the left part.

  138. def lock[R, E, A](executor: ⇒ Executor)(zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    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. See ZIO!.lock.

  139. def loop[R, E, A, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZIO[R, E, A]): ZIO[R, E, List[A]]

    Permalink

    Loops with the specified effectual function, collecting the results into a list.

    Loops with the specified effectual function, collecting the results into a list. The moral equivalent of:

    var s  = initial
    var as = List.empty[A]
    
    while (cont(s)) {
      as = body(s) :: as
      s  = inc(s)
    }
    
    as.reverse
  140. def loopDiscard[R, E, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Loops with the specified effectual function purely for its effects.

    Loops with the specified effectual function purely for its effects. The moral equivalent of:

    var s = initial
    
    while (cont(s)) {
      body(s)
      s = inc(s)
    }
  141. def memoize[R, E, A, B](f: (A) ⇒ ZIO[R, E, B]): UIO[(A) ⇒ ZIO[R, E, B]]

    Permalink

    Returns a memoized version of the specified effectual function.

  142. def mergeAll[R, E, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]

    Permalink

    Merges an Iterable[IO] to a single IO, working sequentially.

  143. def mergeAllPar[R, E, A, B](in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]

    Permalink

    Merges an Iterable[IO] to a single IO, working in parallel.

    Merges an Iterable[IO] to a single IO, working in parallel.

    Due to the parallel nature of this combinator, f must be both: - commutative: f(a, b) == f(b, a) - associative: f(a, f(b, c)) == f(f(a, b), c)

    It's unsafe to execute side effects inside f, as f may be executed more than once for some of in elements during effect execution.

  144. def mergeAllParN[R, E, A, B](n: Int)(in: Iterable[ZIO[R, E, A]])(zero: B)(f: (B, A) ⇒ B): ZIO[R, E, B]

    Permalink

    Merges an Iterable[IO] to a single IO, working in with up to n fibers in parallel.

    Merges an Iterable[IO] to a single IO, working in with up to n fibers in parallel.

    Due to the parallel nature of this combinator, f must be both: - commutative: f(a, b) == f(b, a) - associative: f(a, f(b, c)) == f(f(a, b), c)

    It's unsafe to execute side effects inside f, as f may be executed more than once for some of in elements during effect execution.

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

    Permalink
    Definition Classes
    AnyRef
  146. lazy val never: UIO[Nothing]

    Permalink

    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. Fibers that suspended running this effect are automatically garbage collected on the JVM, because they cannot be reactivated.

  147. lazy val none: UIO[Option[Nothing]]

    Permalink

    Returns an effect with the empty value.

  148. def noneOrFail[E](o: Option[E]): IO[E, Unit]

    Permalink

    Lifts an Option into a IO.

    Lifts an Option into a IO. If the option is empty it succeeds with Unit. If the option is defined it fails with the content.

  149. def noneOrFailWith[E, O](o: Option[O])(f: (O) ⇒ E): IO[E, Unit]

    Permalink

    Lifts an Option into a IO.

    Lifts an Option into a IO. If the option is empty it succeeds with Unit. If the option is defined it fails with an error adapted with f.

  150. def not[R, E](effect: ZIO[R, E, Boolean]): ZIO[R, E, Boolean]

    Permalink

    Returns a new effect where boolean value of this effect is negated.

  151. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  153. def partition[R, E, A, B](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, B])(implicit ev: CanFail[E]): ZIO[R, Nothing, (Iterable[E], Iterable[B])]

    Permalink

    Feeds elements of type A to a function f that returns an effect.

    Feeds elements of type A to a function f that returns an effect. Collects all successes and failures in a tupled fashion.

  154. def partitionPar[R, E, A, B](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, B])(implicit ev: CanFail[E]): ZIO[R, Nothing, (Iterable[E], Iterable[B])]

    Permalink

    Feeds elements of type A to a function f that returns an effect.

    Feeds elements of type A to a function f that returns an effect. Collects all successes and failures in parallel and returns the result as a tuple.

  155. def partitionParN[R, E, A, B](n: Int)(in: Iterable[A])(f: (A) ⇒ ZIO[R, E, B])(implicit ev: CanFail[E]): ZIO[R, Nothing, (Iterable[E], Iterable[B])]

    Permalink

    Feeds elements of type A to a function f that returns an effect.

    Feeds elements of type A to a function f that returns an effect. Collects all successes and failures in parallel and returns the result as a tuple.

    Unlike partitionPar, this method will use at most up to n fibers.

  156. def provide[R, E, A](r: ⇒ R): (ZIO[R, E, A]) ⇒ IO[E, A]

    Permalink

    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 as inject.

  157. def raceAll[R, R1 <: R, E, A](zio: ZIO[R, E, A], ios: Iterable[ZIO[R1, E, A]]): ZIO[R1, E, A]

    Permalink

    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.

  158. def reduceAll[R, R1 <: R, E, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]

    Permalink

    Reduces an Iterable[IO] to a single IO, working sequentially.

  159. def reduceAllPar[R, R1 <: R, E, A](a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]

    Permalink

    Reduces an Iterable[IO] to a single IO, working in parallel.

  160. def reduceAllParN[R, R1 <: R, E, A](n: Int)(a: ZIO[R, E, A], as: Iterable[ZIO[R1, E, A]])(f: (A, A) ⇒ A): ZIO[R1, E, A]

    Permalink

    Reduces an Iterable[IO] to a single IO, working in up to n fibers in parallel.

  161. def replicate[R, E, A](n: Int)(effect: ZIO[R, E, A]): Iterable[ZIO[R, E, A]]

    Permalink

    Replicates the given effect n times.

    Replicates the given effect n times. If 0 or negative numbers are given, an empty Iterable will be returned. This method is more efficient than using List.fill or similar methods, because the returned Iterable consumes only a small amount of heap regardless of n.

  162. def replicateZIO[R, E, A](n: Int)(effect: ZIO[R, E, A]): ZIO[R, E, Iterable[A]]

    Permalink

    Performs this effect the specified number of times and collects the results.

  163. def replicateZIODiscard[R, E, A](n: Int)(effect: ZIO[R, E, A]): ZIO[R, E, Unit]

    Permalink

    Performs this effect the specified number of times, discarding the results.

  164. def reserve[R, E, A, B](reservation: ZIO[R, E, Reservation[R, E, A]])(use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    Acquires a resource, uses the resource, and then releases the resource.

    Acquires a resource, uses the resource, and then releases the resource. However, unlike acquireReleaseWith, 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.

  165. def right[B](b: ⇒ B): UIO[Either[Nothing, B]]

    Permalink

    Returns an effect with the value on the right part.

  166. def runtime[R]: URIO[R, Runtime[R]]

    Permalink

    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 legacy code that must call back into ZIO code.

  167. def scopeWith[R, E, A](f: (ZScope[Exit[Any, Any]]) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Passes the fiber's scope to the specified function, which creates an effect that will be returned from this method.

  168. def service[A](implicit arg0: zio.Tag[A]): URIO[Has[A], A]

    Permalink

    Accesses the specified service in the environment of the effect.

  169. def serviceWith[Service]: ServiceWithPartiallyApplied[Service]

    Permalink

    Effectfully accesses the specified service in the environment of the effect.

    Effectfully accesses the specified service in the environment of the effect.

    Especially useful for creating "accessor" methods on Services' companion objects.

    def foo(int: Int) = ZIO.serviceWith[Foo](_.foo(int))
  170. def setState[S](s: S)(implicit arg0: zio.Tag[S]): ZIO[Has[ZState[S]], Nothing, Unit]

    Permalink

    Sets a state in the environment to the specified value.

  171. def shift(executor: Executor): UIO[Unit]

    Permalink

    Returns an effect that shifts execution to the specified executor.

    Returns an effect that shifts execution to the specified executor. This is useful to specify a default executor that effects sequenced after this one will be run on if they are not shifted somewhere else. It can also be used to implement higher level operators to manage where an effect is run such as ZIO!.lock and ZIO!.on.

  172. def sleep(duration: ⇒ zio.Duration): URIO[Has[Clock], Unit]

    Permalink

    Returns an effect that suspends for the specified duration.

    Returns an effect that suspends for the specified duration. This method is asynchronous, and does not actually block the fiber executing the effect.

  173. def some[A](a: ⇒ A): UIO[Option[A]]

    Permalink

    Returns an effect with the optional value.

  174. def succeed[A](a: ⇒ A): UIO[A]

    Permalink

    Returns an effect that models success with the specified value.

  175. def succeedBlocking[A](a: ⇒ A): UIO[A]

    Permalink

    Returns a synchronous effect that does blocking and succeeds with the specified value.

  176. def suspend[R, A](rio: ⇒ RIO[R, A]): RIO[R, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effect(io)).

  177. def suspendSucceed[R, E, A](zio: ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(succeed(zio)). If you wonder if the effect throws exceptions, do not use this method, use Task.suspend or ZIO.suspend.

  178. def suspendSucceedWith[R, E, A](f: (Platform, Id) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(succeed(zio)). If you wonder if the effect throws exceptions, do not use this method, use Task.suspend or ZIO.suspend.

  179. def suspendWith[R, A](f: (Platform, Id) ⇒ RIO[R, A]): RIO[R, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effect(io)).

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

    Permalink
    Definition Classes
    AnyRef
  181. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  182. def trace: UIO[ZTrace]

    Permalink

    Capture ZIO trace at the current point

  183. def traced[R, E, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Prefix form of ZIO#traced.

  184. def transplant[R, E, A](f: (Grafter) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Transplants specified effects so that when those effects fork other effects, the forked effects will be governed by the scope of the fiber that executes this effect.

    Transplants specified effects so that when those effects fork other effects, the forked effects will be governed by the scope of the fiber that executes this effect.

    This can be used to "graft" deep grandchildren onto a higher-level scope, effectively extending their lifespans into the parent scope.

  185. def uninterruptible[R, E, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Prefix form of ZIO#uninterruptible.

  186. def uninterruptibleMask[R, E, A](k: (InterruptStatusRestore) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    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.

  187. lazy val unit: UIO[Unit]

    Permalink

    An effect that succeeds with a unit value.

  188. def unless[R, E](b: ⇒ Boolean)(zio: ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    The moral equivalent of if (!p) exp

  189. def unlessZIO[R, E](b: ZIO[R, E, Boolean]): UnlessZIO[R, E]

    Permalink

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

  190. def unsandbox[R, E, A](v: ZIO[R, Cause[E], A]): ZIO[R, E, A]

    Permalink

    The inverse operation IO.sandboxed

    The inverse operation IO.sandboxed

    Terminates with exceptions on the Left side of the Either error, if it exists. Otherwise extracts the contained IO[E, A]

  191. def unshift: UIO[Unit]

    Permalink

    Returns an effect indicating that execution is no longer required to be performed on the current executor.

    Returns an effect indicating that execution is no longer required to be performed on the current executor. The runtime may continue executing on this executor for efficiency but will not automatically shift back to it after completing an effect on another executor.

  192. def untraced[R, E, A](zio: ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Prefix form of ZIO#untraced.

  193. def updateState[S](f: (S) ⇒ S)(implicit arg0: zio.Tag[S]): ZIO[Has[ZState[S]], Nothing, Unit]

    Permalink

    Updates a state in the environment with the specified function.

  194. def validate[R, E, A, B](in: NonEmptyChunk[A])(f: (A) ⇒ ZIO[R, E, B])(implicit ev: CanFail[E]): ZIO[R, ::[E], NonEmptyChunk[B]]

    Permalink

    Feeds elements of type A to f and accumulates all errors in error channel or successes in success channel.

    Feeds elements of type A to f and accumulates all errors in error channel or successes in success channel.

    This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partition.

  195. def validate[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]], ev: CanFail[E]): ZIO[R, ::[E], Collection[B]]

    Permalink

    Feeds elements of type A to f and accumulates all errors in error channel or successes in success channel.

    Feeds elements of type A to f and accumulates all errors in error channel or successes in success channel.

    This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partition.

  196. def validateDiscard[R, E, A](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any])(implicit ev: CanFail[E]): ZIO[R, ::[E], Unit]

    Permalink

    Feeds elements of type A to f and accumulates all errors, discarding the successes.

  197. def validateFirst[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], E, Collection[E]], ev: CanFail[E]): ZIO[R, Collection[E], B]

    Permalink

    Feeds elements of type A to f until it succeeds.

    Feeds elements of type A to f until it succeeds. Returns first success or the accumulation of all errors.

  198. def validateFirstPar[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], E, Collection[E]], ev: CanFail[E]): ZIO[R, Collection[E], B]

    Permalink

    Feeds elements of type A to f, in parallel, until it succeeds.

    Feeds elements of type A to f, in parallel, until it succeeds. Returns first success or the accumulation of all errors.

    In case of success all other running fibers are terminated.

  199. def validatePar[R, E, A, B](in: NonEmptyChunk[A])(f: (A) ⇒ ZIO[R, E, B])(implicit ev: CanFail[E]): ZIO[R, ::[E], NonEmptyChunk[B]]

    Permalink

    Feeds elements of type A to f and accumulates, in parallel, all errors in error channel or successes in success channel.

    Feeds elements of type A to f and accumulates, in parallel, all errors in error channel or successes in success channel.

    This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partitionPar.

  200. def validatePar[R, E, A, B, Collection[+Element] <: Iterable[Element]](in: Collection[A])(f: (A) ⇒ ZIO[R, E, B])(implicit bf: zio.BuildFrom[Collection[A], B, Collection[B]], ev: CanFail[E]): ZIO[R, ::[E], Collection[B]]

    Permalink

    Feeds elements of type A to f and accumulates, in parallel, all errors in error channel or successes in success channel.

    Feeds elements of type A to f and accumulates, in parallel, all errors in error channel or successes in success channel.

    This combinator is lossy meaning that if there are errors all successes will be lost. To retain all information please use partitionPar.

  201. def validateParDiscard[R, E, A](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any])(implicit ev: CanFail[E]): ZIO[R, ::[E], Unit]

    Permalink

    Feeds elements of type A to f in parallel and accumulates all errors, discarding the successes.

  202. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  205. def when[R, E](b: ⇒ Boolean)(zio: ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    The moral equivalent of if (p) exp

  206. def whenCase[R, E, A](a: ⇒ A)(pf: PartialFunction[A, ZIO[R, E, Any]]): ZIO[R, E, Unit]

    Permalink

    Runs an effect when the supplied PartialFunction matches for the given value, otherwise does nothing.

  207. def whenCaseZIO[R, E, A](a: ZIO[R, E, A])(pf: PartialFunction[A, ZIO[R, E, Any]]): ZIO[R, E, Unit]

    Permalink

    Runs an effect when the supplied PartialFunction matches for the given effectful value, otherwise does nothing.

  208. def whenZIO[R, E](b: ZIO[R, E, Boolean]): WhenZIO[R, E]

    Permalink

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

  209. def withChildren[R, E, A](get: (UIO[Chunk[Fiber.Runtime[Any, Any]]]) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Locally installs a supervisor and an effect that succeeds with all the children that have been forked in the returned effect.

  210. lazy val yieldNow: UIO[Unit]

    Permalink

    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.

Deprecated Value Members

  1. def accessM[R]: AccessZIOPartiallyApplied[R]

    Permalink

    Effectfully accesses the environment of the effect.

    Effectfully accesses the environment of the effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use accessZIO

  2. def bracket[R, E, A, B](acquire: ZIO[R, E, A], release: (A) ⇒ URIO[R, Any], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use acquireReleaseWith

  3. def bracket[R, E, A](acquire: ZIO[R, E, A]): BracketAcquire[R, E, A]

    Permalink

    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 the use effect succeeds. If this fail-fast behavior is not desired, errors produced by the release effect can be caught and ignored.

    openFile("data.json").bracket(closeFile) { file =>
      for {
        header <- readHeader(file)
        ...
      } yield result
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use acquireReleaseWith

  4. def bracketExit[R, E, A, B](acquire: ZIO[R, E, A], release: (A, Exit[E, B]) ⇒ URIO[R, Any], use: (A) ⇒ ZIO[R, E, B]): ZIO[R, E, B]

    Permalink

    Uncurried version.

    Uncurried version. Doesn't offer curried syntax and has worse type-inference characteristics, but guarantees no extra allocations of intermediate zio.ZIO.BracketExitAcquire and zio.ZIO.BracketExitRelease objects.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use acquireReleaseExitWith

  5. def bracketExit[R, E, A](acquire: ZIO[R, E, A]): BracketExitAcquire[R, E, A]

    Permalink

    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. If use fails, then after release, the returned effect will fail with the same error.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use acquireReleaseExitWith

  6. def collectAllParN_[R, E, A](n: Int)(as: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure in parallel, and discard the results.

    Evaluate each effect in the structure in parallel, and discard the results. For a sequential version, see collectAll_.

    Unlike collectAllPar_, this method will use at most n fibers.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectAllParNDiscard

  7. def collectAllPar_[R, E, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure in parallel, and discard the results.

    Evaluate each effect in the structure in parallel, and discard the results. For a sequential version, see collectAll_.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectAllParDiscard

  8. def collectAll_[R, E, A](in: Iterable[ZIO[R, E, A]]): ZIO[R, E, Unit]

    Permalink

    Evaluate each effect in the structure from left to right, and discard the results.

    Evaluate each effect in the structure from left to right, and discard the results. For a parallel version, see collectAllPar_.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectAllDiscard

  9. def effect[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous side-effect into a pure ZIO value, translating any thrown exceptions into typed failed effects creating with ZIO.fail.

    Imports a synchronous side-effect into a pure ZIO value, translating any thrown exceptions into typed failed effects creating with ZIO.fail.

    def printLine(line: String): Task[Unit] = Task.effect(println(line))
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use attempt

  10. def effectAsync[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Any, blockingOn: Id = null): ZIO[R, E, A]

    Permalink

    Imports an asynchronous side-effect into a pure ZIO value.

    Imports an asynchronous side-effect into a pure ZIO value. See effectAsyncMaybe for the more expressive variant of this function that can return a value synchronously.

    The callback function ZIO[R, E, A] => Any must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use async

  11. def effectAsyncInterrupt[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Either[Canceler[R], ZIO[R, E, A]], blockingOn: Id = Fiber.Id.None): ZIO[R, E, A]

    Permalink

    Imports an asynchronous side-effect into a ZIO effect.

    Imports an asynchronous side-effect into a ZIO effect. The side-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 side-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.

    If the register function returns a value synchronously, then the callback function ZIO[R, E, A] => Any must not be called. Otherwise the callback function must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use asyncInterrupt

  12. def effectAsyncM[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ ZIO[R, E, Any]): ZIO[R, E, A]

    Permalink

    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 of ZIO.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use asyncZIO

  13. def effectAsyncMaybe[R, E, A](register: ((ZIO[R, E, A]) ⇒ Unit) ⇒ Option[ZIO[R, E, A]], blockingOn: Id = Fiber.Id.None): ZIO[R, E, A]

    Permalink

    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.

    If the register function returns a value synchronously, then the callback function ZIO[R, E, A] => Any must not be called. Otherwise the callback function must be called at most once.

    The list of fibers, that may complete the async callback, is used to provide better diagnostics.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use asyncMaybe

  14. def effectAsyncWithCompletionHandler[T](op: (CompletionHandler[T, Any]) ⇒ Any): Task[T]

    Permalink
    Definition Classes
    ZIOCompanionPlatformSpecific
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use asyncWithCompletionHandler

  15. def effectBlocking[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value.

    Imports a synchronous effect that does blocking IO into a pure value.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use attemptBlocking

  16. def effectBlockingCancelable[A](effect: ⇒ A)(cancel: UIO[Unit]): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value, with a custom cancel effect.

    Imports a synchronous effect that does blocking IO into a pure value, with a custom cancel effect.

    If the returned ZIO is interrupted, the blocked thread running the synchronous effect will be interrupted via the cancel effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use attemptBlockingCancelable

  17. def effectBlockingIO[A](effect: ⇒ A): IO[IOException, A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value, refining the error type to java.io.IOException.

    Imports a synchronous effect that does blocking IO into a pure value, refining the error type to java.io.IOException.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use attemptBlockingIO

  18. def effectBlockingInterrupt[A](effect: ⇒ A): Task[A]

    Permalink

    Imports a synchronous effect that does blocking IO into a pure value.

    Imports a synchronous effect that does blocking IO into a pure value.

    If the returned ZIO is interrupted, the blocked thread running the synchronous effect will be interrupted via Thread.interrupt.

    Note that this adds significant overhead. For performance sensitive applications consider using effectBlocking or effectBlockingCancel.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use attemptBlockingInterrupt

  19. def effectSuspend[R, A](rio: ⇒ RIO[R, A]): RIO[R, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effect(io)).

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suspend

  20. def effectSuspendTotal[R, E, A](zio: ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effectTotal(zio)). If you wonder if the effect throws exceptions, do not use this method, use Task.effectSuspend or ZIO.effectSuspend.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suspendSucceed

  21. def effectSuspendTotalWith[R, E, A](f: (Platform, Id) ⇒ ZIO[R, E, A]): ZIO[R, E, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. The effect must not throw any exceptions. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effectTotal(zio)). If you wonder if the effect throws exceptions, do not use this method, use Task.effectSuspend or ZIO.effectSuspend.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suspendSucceedWith

  22. def effectSuspendWith[R, A](f: (Platform, Id) ⇒ RIO[R, A]): RIO[R, A]

    Permalink

    Returns a lazily constructed effect, whose construction may itself require effects.

    Returns a lazily constructed effect, whose construction may itself require effects. When no environment is required (i.e., when R == Any) it is conceptually equivalent to flatten(effect(io)).

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suspendWith

  23. def effectTotal[A](effect: ⇒ A): UIO[A]

    Permalink

    Captures a synchronous computation into a lazy effect, which can be executed later and repeatedly.

    Captures a synchronous computation into a lazy effect, which can be executed later and repeatedly. The synchronous computation must not throw any exceptions. If you are unsure, then don't use this method, use Task.effect, IO.effect, or ZIO.effect.

    val nanoTime: UIO[Long] = IO.succeed(System.nanoTime())
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use succeed

  24. def foreachParN_[R, E, A](n: Int)(as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Unlike foreachPar_, this method will use at most up to n fibers.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foreachParNDiscard

  25. def foreachPar_[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    Applies the function f to each element of the Iterable[A] and runs produced effects in parallel, discarding the results.

    For a sequential version of this method, see foreach_.

    Optimized to avoid keeping full tree of effects, so that method could be able to handle large input sequences. Behaves almost like this code:

    as.foldLeft(ZIO.unit) { (acc, a) => acc.zipParLeft(f(a)) }

    Additionally, interrupts all effects on any failure.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foreachParDiscard

  26. def foreach_[R, E, A](as: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Applies the function f to each element of the Iterable[A] and runs produced effects sequentially.

    Applies the function f to each element of the Iterable[A] and runs produced effects sequentially.

    Equivalent to foreach(as)(f).unit, but without the cost of building the list of results.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foreachDiscard

  27. def forkAll_[R, E, A](as: Iterable[ZIO[R, E, A]]): URIO[R, Unit]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use forkAllDiscard

  28. def fromFiberM[E, A](fiber: IO[E, Fiber[E, A]]): IO[E, A]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use fromFiberZIO

  29. def fromFunction[R, A](f: (R) ⇒ A): URIO[R, A]

    Permalink

    Lifts a function R => A into a URIO[R, A].

    Lifts a function R => A into a URIO[R, A].

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use access

  30. def fromFunctionM[R, E, A](f: (R) ⇒ IO[E, A]): ZIO[R, E, A]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use accessZIO

  31. def halt[E](cause: ⇒ Cause[E]): IO[E, Nothing]

    Permalink

    Returns an effect that models failure with the specified Cause.

    Returns an effect that models failure with the specified Cause.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use failCause

  32. def haltWith[E](function: (() ⇒ ZTrace) ⇒ Cause[E]): IO[E, Nothing]

    Permalink

    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 via Cause.Traced.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use failCauseWith

  33. def ifM[R, E](b: ZIO[R, E, Boolean]): IfZIO[R, E]

    Permalink

    Runs onTrue if the result of b is true and onFalse otherwise.

    Runs onTrue if the result of b is true and onFalse otherwise.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use ifZIO

  34. def loop_[R, E, S](initial: S)(cont: (S) ⇒ Boolean, inc: (S) ⇒ S)(body: (S) ⇒ ZIO[R, E, Any]): ZIO[R, E, Unit]

    Permalink

    Loops with the specified effectual function purely for its effects.

    Loops with the specified effectual function purely for its effects. The moral equivalent of:

    var s = initial
    
    while (cont(s)) {
      body(s)
      s = inc(s)
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use loopDiscard

  35. def mapN[R, E, A, B, C, D, F](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C], zio4: ZIO[R, E, D])(f: (A, B, C, D) ⇒ F): ZIO[R, E, F]

    Permalink

    Sequentially zips the specified effects using the specified combiner function.

    Sequentially zips the specified effects using the specified combiner function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  36. def mapN[R, E, A, B, C, D](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C])(f: (A, B, C) ⇒ D): ZIO[R, E, D]

    Permalink

    Sequentially zips the specified effects using the specified combiner function.

    Sequentially zips the specified effects using the specified combiner function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  37. def mapN[R, E, A, B, C](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B])(f: (A, B) ⇒ C): ZIO[R, E, C]

    Permalink

    Sequentially zips the specified effects using the specified combiner function.

    Sequentially zips the specified effects using the specified combiner function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  38. def mapParN[R, E, A, B, C, D, F](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C], zio4: ZIO[R, E, D])(f: (A, B, C, D) ⇒ F): ZIO[R, E, F]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  39. def mapParN[R, E, A, B, C, D](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C])(f: (A, B, C) ⇒ D): ZIO[R, E, D]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  40. def mapParN[R, E, A, B, C](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B])(f: (A, B) ⇒ C): ZIO[R, E, C]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  41. def replicateM[R, E, A](n: Int)(effect: ZIO[R, E, A]): ZIO[R, E, Iterable[A]]

    Permalink

    Performs this effect the specified number of times and collects the results.

    Performs this effect the specified number of times and collects the results.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use replicateZIO

  42. def replicateM_[R, E, A](n: Int)(effect: ZIO[R, E, A]): ZIO[R, E, Unit]

    Permalink

    Performs this effect the specified number of times, discarding the results.

    Performs this effect the specified number of times, discarding the results.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use replicateZIODiscard

  43. def require[R, E, A](error: ⇒ E): (ZIO[R, E, Option[A]]) ⇒ ZIO[R, E, A]

    Permalink

    Requires that the given ZIO[R, E, Option[A]] contain a value.

    Requires that the given ZIO[R, E, Option[A]] contain a value. If there is no value, then the specified error will be raised.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use someOrFail

  44. def services[A, B, C, D](implicit arg0: zio.Tag[A], arg1: zio.Tag[B], arg2: zio.Tag[C], arg3: zio.Tag[D]): URIO[Has[A] with Has[B] with Has[C] with Has[D], (A, B, C, D)]

    Permalink

    Accesses the specified services in the environment of the effect.

    Accesses the specified services in the environment of the effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use service

  45. def services[A, B, C](implicit arg0: zio.Tag[A], arg1: zio.Tag[B], arg2: zio.Tag[C]): URIO[Has[A] with Has[B] with Has[C], (A, B, C)]

    Permalink

    Accesses the specified services in the environment of the effect.

    Accesses the specified services in the environment of the effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use service

  46. def services[A, B](implicit arg0: zio.Tag[A], arg1: zio.Tag[B]): URIO[Has[A] with Has[B], (A, B)]

    Permalink

    Accesses the specified services in the environment of the effect.

    Accesses the specified services in the environment of the effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use service

  47. def tupled[R, E, A, B, C, D](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C], zio4: ZIO[R, E, D]): ZIO[R, E, (A, B, C, D)]

    Permalink

    Sequentially zips the specified effects.

    Sequentially zips the specified effects. Specialized version of mapN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  48. def tupled[R, E, A, B, C](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C]): ZIO[R, E, (A, B, C)]

    Permalink

    Sequentially zips the specified effects.

    Sequentially zips the specified effects. Specialized version of mapN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  49. def tupled[R, E, A, B](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B]): ZIO[R, E, (A, B)]

    Permalink

    Sequentially zips the specified effects.

    Sequentially zips the specified effects. Specialized version of mapN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  50. def tupledPar[R, E, A, B, C, D](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C], zio4: ZIO[R, E, D]): ZIO[R, E, (A, B, C, D)]

    Permalink

    Zips the specified effects in parallel.

    Zips the specified effects in parallel. Specialized version of mapParN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  51. def tupledPar[R, E, A, B, C](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B], zio3: ZIO[R, E, C]): ZIO[R, E, (A, B, C)]

    Permalink

    Zips the specified effects in parallel.

    Zips the specified effects in parallel. Specialized version of mapParN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  52. def tupledPar[R, E, A, B](zio1: ZIO[R, E, A], zio2: ZIO[R, E, B]): ZIO[R, E, (A, B)]

    Permalink

    Zips the specified effects in parallel.

    Zips the specified effects in parallel. Specialized version of mapParN.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipPar

  53. def unlessM[R, E](b: ZIO[R, E, Boolean]): UnlessZIO[R, E]

    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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use unlessZIO

  54. def validatePar_[R, E, A](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any])(implicit ev: CanFail[E]): ZIO[R, ::[E], Unit]

    Permalink

    Feeds elements of type A to f in parallel and accumulates all errors, discarding the successes.

    Feeds elements of type A to f in parallel and accumulates all errors, discarding the successes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use validateParDiscard

  55. def validate_[R, E, A](in: Iterable[A])(f: (A) ⇒ ZIO[R, E, Any])(implicit ev: CanFail[E]): ZIO[R, ::[E], Unit]

    Permalink

    Feeds elements of type A to f and accumulates all errors, discarding the successes.

    Feeds elements of type A to f and accumulates all errors, discarding the successes.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use validateDiscard

  56. def whenCaseM[R, E, A](a: ZIO[R, E, A])(pf: PartialFunction[A, ZIO[R, E, Any]]): ZIO[R, E, Unit]

    Permalink

    Runs an effect when the supplied PartialFunction matches for the given effectful value, otherwise does nothing.

    Runs an effect when the supplied PartialFunction matches for the given effectful value, otherwise does nothing.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use whenCaseZIO

  57. def whenM[R, E](b: ZIO[R, E, Boolean]): WhenZIO[R, E]

    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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use whenZIO

Inherited from Serializable

Inherited from Serializable

Inherited from ZIOCompanionPlatformSpecific

Inherited from AnyRef

Inherited from Any

Ungrouped