Class/Object

zio

ZManaged

Related Docs: object ZManaged | package zio

Permalink

final class ZManaged[-R, +E, +A] extends Serializable

A ZManaged[R, E, A] is a managed resource of type A, which may be used by invoking the use method of the resource. The resource will be automatically acquired before the resource is used, and automatically released after the resource is used.

Resources do not survive the scope of use, meaning that if you attempt to capture the resource, leak it from use, and then use it after the resource has been consumed, the resource will not be valid anymore and may fail with some checked error, as per the type of the functions provided by the resource.

Self Type
ZManaged[R, E, A]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZManaged
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def &&&[R1 <: R, E1 >: E, B](that: ZManaged[R1, E1, B]): ZManaged[R1, E1, (A, B)]

    Permalink

    Symbolic alias for zip.

  4. def &>[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A1]

    Permalink

    Symbolic alias for zipParRight

  5. def ***[R1, E1 >: E, B](that: ZManaged[R1, E1, B]): ZManaged[(R, R1), E1, (A, B)]

    Permalink

    Splits the environment, providing the first part to this effect and the second part to that effect.

  6. def *>[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A1]

    Permalink

    Symbolic alias for zipRight

  7. def +++[R1, B, E1 >: E](that: ZManaged[R1, E1, B]): ZManaged[Either[R, R1], E1, Either[A, B]]

    Permalink
  8. def <&[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A]

    Permalink

    Symbolic alias for zipParLeft

  9. def <&>[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, (A, A1)]

    Permalink

    Symbolic alias for zipPar

  10. def <*[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A]

    Permalink

    Symbolic alias for zipLeft.

  11. def <*>[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, (A, A1)]

    Permalink

    Symbolic alias for zip.

  12. def <<<[R1, E1 >: E](that: ZManaged[R1, E1, R]): ZManaged[R1, E1, A]

    Permalink

    Symbolic alias for compose

  13. def <>[R1 <: R, E2, A1 >: A](that: ⇒ ZManaged[R1, E2, A1])(implicit ev: CanFail[E]): ZManaged[R1, E2, A1]

    Permalink

    Operator alias for orElse.

  14. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def >>=[R1 <: R, E1 >: E, B](k: (A) ⇒ ZManaged[R1, E1, B]): ZManaged[R1, E1, B]

    Permalink

    Symbolic alias for flatMap

  16. def >>>[R1 >: A, E1 >: E, B](that: ZManaged[R1, E1, B]): ZManaged[R, E1, B]

    Permalink

    Symbolic alias for andThen

  17. def absolve[R1 <: R, E1, B](implicit ev: <:<[ZManaged[R, E, A], ZManaged[R1, E1, Either[E1, B]]]): ZManaged[R1, E1, B]

    Permalink

    Submerges the error case of an Either into the ZManaged.

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

  18. def absorb(implicit ev: <:<[E, Throwable]): ZManaged[R, Throwable, A]

    Permalink

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

  19. def absorbWith(f: (E) ⇒ Throwable): ZManaged[R, Throwable, A]

    Permalink

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

  20. def andThen[R1 >: A, E1 >: E, B](that: ZManaged[R1, E1, B]): ZManaged[R, E1, B]

    Permalink

    Executes the this effect and then provides its output as an environment to the second effect

  21. def as[B](b: ⇒ B): ZManaged[R, E, B]

    Permalink

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

  22. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  23. def asService[A1 >: A](implicit tagged: Tagged[A1]): ZManaged[R, E, Has[A1]]

    Permalink

    Maps the success value of this effect to a service.

  24. final def asSome: ZManaged[R, E, Option[A]]

    Permalink

    Maps the success value of this effect to an optional value.

  25. final def asSomeError: ZManaged[R, Option[E], A]

    Permalink

    Maps the error value of this effect to an optional value.

  26. def bimap[E1, A1](f: (E) ⇒ E1, g: (A) ⇒ A1)(implicit ev: CanFail[E]): ZManaged[R, E1, A1]

    Permalink

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

  27. def catchAll[R1 <: R, E2, A1 >: A](h: (E) ⇒ ZManaged[R1, E2, A1])(implicit ev: CanFail[E]): ZManaged[R1, E2, A1]

    Permalink

    Recovers from all errors.

  28. def catchAllCause[R1 <: R, E2, A1 >: A](h: (Cause[E]) ⇒ ZManaged[R1, E2, A1]): ZManaged[R1, E2, A1]

    Permalink

    Recovers from all errors with provided Cause.

    Recovers from all errors with provided Cause.

    managed.catchAllCause(_ => ZManaged.succeed(defaultConfig))
    See also

    absorb, sandbox, mapErrorCause - other functions that can recover from defects

  29. def catchSome[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[E, ZManaged[R1, E1, A1]])(implicit ev: CanFail[E]): ZManaged[R1, E1, A1]

    Permalink

    Recovers from some or all of the error cases.

  30. def catchSomeCause[R1 <: R, E1 >: E, A1 >: A](pf: PartialFunction[Cause[E], ZManaged[R1, E1, A1]]): ZManaged[R1, E1, A1]

    Permalink

    Recovers from some or all of the error Causes.

  31. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def collect[E1 >: E, B](e: ⇒ E1)(pf: PartialFunction[A, B]): ZManaged[R, E1, B]

    Permalink

    Fail with e if the supplied PartialFunction does not match, otherwise succeed with the returned value.

  33. def collectM[R1 <: R, E1 >: E, B](e: ⇒ E1)(pf: PartialFunction[A, ZManaged[R1, E1, B]]): ZManaged[R1, E1, B]

    Permalink

    Fail with e if the supplied PartialFunction does not match, otherwise continue with the returned value.

  34. def compose[R1, E1 >: E](that: ZManaged[R1, E1, R]): ZManaged[R1, E1, A]

    Permalink

    Executes the second effect and then provides its output as an environment to this effect

  35. def either(implicit ev: CanFail[E]): ZManaged[R, Nothing, Either[E, A]]

    Permalink

    Returns an effect whose failure and success have been lifted into an Either.The resulting effect cannot fail

  36. def ensuring[R1 <: R](f: ZIO[R1, Nothing, Any]): ZManaged[R1, E, A]

    Permalink

    Ensures that f is executed when this ZManaged is finalized, after the existing finalizer.

    Ensures that f is executed when this ZManaged is finalized, after the existing finalizer.

    For usecases that need access to the ZManaged's result, see ZManaged#onExit.

  37. def ensuringFirst[R1 <: R](f: ZIO[R1, Nothing, Any]): ZManaged[R1, E, A]

    Permalink

    Ensures that f is executed when this ZManaged is finalized, before the existing finalizer.

    Ensures that f is executed when this ZManaged is finalized, before the existing finalizer.

    For usecases that need access to the ZManaged's result, see ZManaged#onExitFirst.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  40. def eventually(implicit ev: CanFail[E]): ZManaged[R, Nothing, A]

    Permalink

    Returns a ZManaged that ignores errors raised by the acquire effect and runs it repeatedly until it eventually succeeds.

  41. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  42. def first[R1 <: R, A1 >: A]: ZManaged[R1, E, (A1, R1)]

    Permalink

    Zips this effect with its environment

  43. def flatMap[R1 <: R, E1 >: E, B](f0: (A) ⇒ ZManaged[R1, E1, B]): ZManaged[R1, E1, B]

    Permalink

    Returns an effect that models the execution of this effect, followed by the passing of its value to the specified continuation function k, followed by the effect that it returns.

  44. def flatMapError[R1 <: R, E2](f: (E) ⇒ ZManaged[R1, Nothing, E2])(implicit ev: CanFail[E]): ZManaged[R1, E2, A]

    Permalink

    Effectfully map the error channel

  45. def flatten[R1 <: R, E1 >: E, B](implicit ev: <:<[A, ZManaged[R1, E1, B]]): ZManaged[R1, E1, B]

    Permalink

    Returns an effect that performs the outer effect first, followed by the inner effect, yielding the value of the inner effect.

    Returns an effect that performs the outer effect first, followed by the inner effect, yielding the value of the inner effect.

    This method can be used to "flatten" nested effects.

  46. def flip: ZManaged[R, A, E]

    Permalink

    Flip the error and result

  47. def flipWith[R1, A1, E1](f: (ZManaged[R, A, E]) ⇒ ZManaged[R1, A1, E1]): ZManaged[R1, E1, A1]

    Permalink

    Flip the error and result, then apply an effectful function to the effect

  48. def fold[B](failure: (E) ⇒ B, success: (A) ⇒ B)(implicit ev: CanFail[E]): ZManaged[R, Nothing, B]

    Permalink

    Folds over the failure value or the success value to yield an effect that does not fail, but succeeds with the value returned by the left or right function passed to fold.

  49. def foldCause[B](failure: (Cause[E]) ⇒ B, success: (A) ⇒ B): ZManaged[R, E, B]

    Permalink

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

  50. def foldCauseM[R1 <: R, E1, A1](failure: (Cause[E]) ⇒ ZManaged[R1, E1, A1], success: (A) ⇒ ZManaged[R1, E1, A1]): ZManaged[R1, E1, A1]

    Permalink

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

  51. def foldM[R1 <: R, E2, B](failure: (E) ⇒ ZManaged[R1, E2, B], success: (A) ⇒ ZManaged[R1, E2, B])(implicit ev: CanFail[E]): ZManaged[R1, E2, B]

    Permalink

    Recovers from errors by accepting one effect to execute for the case of an error, and one effect to execute for the case of success.

  52. def fork: ZManaged[R, Nothing, Fiber.Runtime[E, A]]

    Permalink

    Creates a ZManaged value that acquires the original resource in a fiber, and provides that fiber.

    Creates a ZManaged value that acquires the original resource in a fiber, and provides that fiber. The finalizer for this value will interrupt the fiber and run the original finalizer.

  53. def get[E1 >: E, B](implicit ev1: =:=[E1, Nothing], ev2: <:<[A, Option[B]]): ZManaged[R, Unit, B]

    Permalink

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

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

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

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

    Permalink
    Definition Classes
    Any
  57. def join[R1, E1 >: E, A1 >: A](that: ZManaged[R1, E1, A1]): ZManaged[Either[R, R1], E1, A1]

    Permalink

    Depending on the environment execute this or the other effect

  58. def left[R1 <: R, C]: ZManaged[Either[R1, C], E, Either[A, C]]

    Permalink
  59. def map[B](f0: (A) ⇒ B): ZManaged[R, E, B]

    Permalink

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

  60. def mapError[E1](f: (E) ⇒ E1)(implicit ev: CanFail[E]): ZManaged[R, E1, A]

    Permalink

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

  61. def mapErrorCause[E1](f: (Cause[E]) ⇒ Cause[E1]): ZManaged[R, E1, A]

    Permalink

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

  62. def mapM[R1 <: R, E1 >: E, B](f: (A) ⇒ ZIO[R1, E1, B]): ZManaged[R1, E1, B]

    Permalink

    Effectfully maps the resource acquired by this value.

  63. def memoize: ZManaged[R, Nothing, ZManaged[Any, E, A]]

    Permalink
  64. def merge[A1 >: A](implicit ev1: <:<[E, A1], ev2: CanFail[E]): ZManaged[R, Nothing, A1]

    Permalink

    Returns a new effect where the error channel has been merged into the success channel to their common combined type.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  68. def onExit[R1 <: R](cleanup: (Exit[E, A]) ⇒ ZIO[R1, Nothing, Any]): ZManaged[R1, E, A]

    Permalink

    Ensures that a cleanup function runs when this ZManaged is finalized, after the existing finalizers.

  69. def onExitFirst[R1 <: R](cleanup: (Exit[E, A]) ⇒ ZIO[R1, Nothing, Any]): ZManaged[R1, E, A]

    Permalink

    Ensures that a cleanup function runs when this ZManaged is finalized, before the existing finalizers.

  70. def option(implicit ev: CanFail[E]): ZManaged[R, Nothing, Option[A]]

    Permalink

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

  71. def orDie(implicit ev1: <:<[E, Throwable], ev2: CanFail[E]): ZManaged[R, Nothing, A]

    Permalink

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

  72. def orDieWith(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): ZManaged[R, Nothing, A]

    Permalink

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

  73. def orElse[R1 <: R, E2, A1 >: A](that: ⇒ ZManaged[R1, E2, A1])(implicit ev: CanFail[E]): ZManaged[R1, E2, A1]

    Permalink

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

  74. def orElseEither[R1 <: R, E2, B](that: ⇒ ZManaged[R1, E2, B])(implicit ev: CanFail[E]): ZManaged[R1, E2, Either[A, B]]

    Permalink

    Returns an effect that will produce the value of this effect, unless it fails, in which case, it will produce the value of the specified effect.

  75. final def orElseFail[E1](e1: ⇒ E1)(implicit ev: CanFail[E]): ZManaged[R, E1, A]

    Permalink

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

  76. final def orElseSucceed[A1 >: A](a1: ⇒ A1)(implicit ev: CanFail[E]): ZManaged[R, Nothing, A1]

    Permalink

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

  77. def preallocate: ZIO[R, E, Managed[Nothing, A]]

    Permalink

    Preallocates the managed resource, resulting in a ZManaged that reserves and acquires immediately and cannot fail.

    Preallocates the managed resource, resulting in a ZManaged that reserves and acquires immediately and cannot fail. You should take care that you are not interrupted between running preallocate and actually acquiring the resource as you might leak otherwise.

  78. def preallocateManaged: ZManaged[R, E, Managed[Nothing, A]]

    Permalink

    Preallocates the managed resource inside an outer managed, resulting in a ZManaged that reserves and acquires immediately and cannot fail.

  79. def provide(r: R)(implicit ev: NeedsEnv[R]): Managed[E, A]

    Permalink

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

  80. def provideCustomLayer[E1 >: E, R1 <: Has[_]](layer: ZLayer[zio.ZEnv, E1, R1])(implicit ev: <:<[zio.ZEnv with R1, R], tagged: Tagged[R1]): ZManaged[zio.ZEnv, E1, A]

    Permalink

    Provides the part of the environment that is not part of the ZEnv, leaving a managed effect that only depends on the ZEnv.

    Provides the part of the environment that is not part of the ZEnv, leaving a managed effect that only depends on the ZEnv.

    val loggingLayer: ZLayer[Any, Nothing, Logging] = ???
    
    val managed: ZManaged[ZEnv with Logging, Nothing, Unit] = ???
    
    val managed2 = managed.provideCustomLayer(loggingLayer)
  81. def provideLayer[E1 >: E, R0, R1 <: Has[_]](layer: ZLayer[R0, E1, R1])(implicit ev1: <:<[R1, R], ev2: NeedsEnv[R]): ZManaged[R0, E1, A]

    Permalink

    Provides a layer to the ZManaged, which translates it to another level.

  82. def provideSome[R0](f: (R0) ⇒ R)(implicit ev: NeedsEnv[R]): ZManaged[R0, E, A]

    Permalink

    Provides some of the environment required to run this effect, leaving the remainder R0.

    Provides some of the environment required to run this effect, leaving the remainder R0.

    val managed: ZManaged[Console with Logging, Nothing, Unit] = ???
    
    managed.provideSome[Console](env =>
      new Console with Logging {
        val console = env.console
        val logging = new Logging.Service[Any] {
          def log(line: String) = console.putStrLn(line)
        }
      }
    )
  83. final def provideSomeLayer[R0 <: Has[_]]: ProvideSomeLayer[R0, R, E, A]

    Permalink

    Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

    Splits the environment into two parts, providing one part using the specified layer and leaving the remainder R0.

    val clockLayer: ZLayer[Any, Nothing, Clock] = ???
    
    val managed: ZManaged[Clock with Random, Nothing, Unit] = ???
    
    val managed2 = managed.provideSomeLayer[Random](clockLayer)
  84. def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: <:<[E, Throwable], ev2: CanFail[E]): ZManaged[R, E1, A]

    Permalink

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

  85. def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): ZManaged[R, E1, A]

    Permalink

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

  86. def refineToOrDie[E1](implicit arg0: ClassTag[E1], ev1: <:<[E, Throwable], ev2: CanFail[E]): ZManaged[R, E1, A]

    Permalink

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

  87. def reserve: ZIO[R, E, Reservation[R, E, A]]

    Permalink

    Gives access to wrapped Reservation.

  88. def retry[R1 <: R, E1 >: E, S](policy: Schedule[R1, E1, S])(implicit ev: CanFail[E]): ZManaged[R1, E1, A]

    Permalink

    Retries with the specified retry policy.

    Retries with the specified retry policy. Retries are done following the failure of the original io (up to a fixed maximum with once or recurs for example), so that that io.retry(Schedule.once) means "execute io and in case of failure, try again once".

  89. def right[R1 <: R, C]: ZManaged[Either[C, R1], E, Either[C, A]]

    Permalink
  90. def run: ZManaged[R, Nothing, Exit[E, A]]

    Permalink

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

  91. def sandbox: ZManaged[R, Cause[E], A]

    Permalink

    Exposes the full cause of failure of this effect.

  92. def sandboxWith[R1 <: R, E2, B](f: (ZManaged[R1, Cause[E], A]) ⇒ ZManaged[R1, Cause[E2], B]): ZManaged[R1, E2, B]

    Permalink

    Companion helper to sandbox.

    Companion helper to sandbox. Allows recovery, and partial recovery, from errors and defects alike.

  93. def second[R1 <: R, A1 >: A]: ZManaged[R1, E, (R1, A1)]

    Permalink

    Zips this effect with its environment

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

    Permalink
    Definition Classes
    AnyRef
  95. def tap[R1 <: R, E1 >: E](f: (A) ⇒ ZManaged[R1, E1, Any]): ZManaged[R1, E1, A]

    Permalink

    Returns an effect that effectfully peeks at the acquired resource.

  96. def tapBoth[R1 <: R, E1 >: E](f: (E) ⇒ ZManaged[R1, E1, Any], g: (A) ⇒ ZManaged[R1, E1, Any])(implicit ev: CanFail[E]): ZManaged[R1, E1, A]

    Permalink

    Returns an effect that effectfully peeks at the failure or success of the acquired resource.

  97. final def tapCause[R1 <: R, E1 >: E](f: (Cause[E]) ⇒ ZManaged[R1, E1, Any]): ZManaged[R1, E1, A]

    Permalink

    Returns an effect that effectually peeks at the cause of the failure of the acquired resource.

  98. def tapError[R1 <: R, E1 >: E](f: (E) ⇒ ZManaged[R1, E1, Any])(implicit ev: CanFail[E]): ZManaged[R1, E1, A]

    Permalink

    Returns an effect that effectfully peeks at the failure of the acquired resource.

  99. def tapM[R1 <: R, E1 >: E](f: (A) ⇒ ZIO[R1, E1, Any]): ZManaged[R1, E1, A]

    Permalink

    Like ZManaged#tap, but uses a function that returns a ZIO value rather than a ZManaged value.

  100. def timed: ZManaged[R with Clock, E, (Duration, A)]

    Permalink

    Returns a new effect that executes this one and times the acquisition of the resource.

  101. def timeout(d: Duration): ZManaged[R with Clock, E, Option[A]]

    Permalink

    Returns an effect that will timeout this resource, returning None if the timeout elapses before the resource was reserved and acquired.

    Returns an effect that will timeout this resource, returning None if the timeout elapses before the resource was reserved and acquired. If the reservation completes successfully (even after the timeout) the release action will be run on a new fiber. Some will be returned if acquisition and reservation complete in time

  102. def toLayer[A1 >: A](implicit tagged: Tagged[A1]): ZLayer[R, E, Has[A1]]

    Permalink

    Constructs a layer from this managed resource.

  103. def toLayerMany[A1 <: Has[_]](implicit ev: <:<[A, A1]): ZLayer[R, E, A1]

    Permalink

    Constructs a layer from this managed resource, which must return one or more services.

  104. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  105. lazy val unit: ZManaged[R, E, Unit]

    Permalink

    Return unit while running the effect

  106. def unsandbox[E1](implicit ev: <:<[E, Cause[E1]]): ZManaged[R, E1, A]

    Permalink

    The inverse operation ZManaged.sandboxed

  107. def use[R1 <: R, E1 >: E, B](f: (A) ⇒ ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Run an effect while acquiring the resource before and releasing it after

  108. val useForever: ZIO[R, E, Nothing]

    Permalink

    Use the resource until interruption.

    Use the resource until interruption. Useful for resources that you want to acquire and use as long as the application is running, like a HTTP server.

  109. def use_[R1 <: R, E1 >: E, B](f: ZIO[R1, E1, B]): ZIO[R1, E1, B]

    Permalink

    Run an effect while acquiring the resource before and releasing it after.

    Run an effect while acquiring the resource before and releasing it after. This does not provide the resource to the function

  110. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  113. def when(b: Boolean): ZManaged[R, E, Unit]

    Permalink

    The moral equivalent of if (p) exp

  114. def whenM[R1 <: R, E1 >: E](b: ZManaged[R1, E1, Boolean]): ZManaged[R1, E1, Unit]

    Permalink

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

  115. def withEarlyRelease: ZManaged[R, E, (URIO[R, Any], A)]

    Permalink

    Modifies this ZManaged to provide a canceler that can be used to eagerly execute the finalizer of this ZManaged.

    Modifies this ZManaged to provide a canceler that can be used to eagerly execute the finalizer of this ZManaged. The canceler will run uninterruptibly with an exit value indicating that the effect was interrupted, and if completed will cause the regular finalizer to not run.

  116. def withEarlyReleaseExit(exit: Exit[Any, Any]): ZManaged[R, E, (URIO[R, Any], A)]

    Permalink

    A more powerful version of withEarlyRelease that allows specifying an exit value in the event of early release.

  117. def zip[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, (A, A1)]

    Permalink

    Named alias for <*>.

  118. def zipLeft[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A]

    Permalink

    Named alias for <*.

  119. def zipPar[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, (A, A1)]

    Permalink

    Named alias for <&>.

  120. def zipParLeft[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A]

    Permalink

    Named alias for <&.

  121. def zipParRight[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A1]

    Permalink

    Named alias for &>.

  122. def zipRight[R1 <: R, E1 >: E, A1](that: ZManaged[R1, E1, A1]): ZManaged[R1, E1, A1]

    Permalink

    Named alias for *>.

  123. def zipWith[R1 <: R, E1 >: E, A1, A2](that: ZManaged[R1, E1, A1])(f: (A, A1) ⇒ A2): ZManaged[R1, E1, A2]

    Permalink

    Returns an effect that executes both this effect and the specified effect, in sequence, combining their results with the specified f function.

  124. def zipWithPar[R1 <: R, E1 >: E, A1, A2](that: ZManaged[R1, E1, A1])(f0: (A, A1) ⇒ A2): ZManaged[R1, E1, A2]

    Permalink

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

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

  125. def |||[R1, E1 >: E, A1 >: A](that: ZManaged[R1, E1, A1]): ZManaged[Either[R, R1], E1, A1]

    Permalink

    Symbolic alias for join

Deprecated Value Members

  1. def asError[E1](e1: ⇒ E1): ZManaged[R, E1, A]

    Permalink

    Replaces the error value (if any) by the value provided.

    Replaces the error value (if any) by the value provided.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use orElseFail

  2. def fallback[A1 >: A](a: ⇒ A1)(implicit ev: CanFail[E]): ZManaged[R, Nothing, A1]

    Permalink

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use orElseSucceed

  3. def provideM[E1 >: E](r: ZIO[Any, E1, R])(implicit ev: NeedsEnv[R]): Managed[E1, A]

    Permalink

    An effectual version of provide, useful when the act of provision requires an effect.

    An effectual version of provide, useful when the act of provision requires an effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use provideLayer

  4. def provideManaged[E1 >: E](r: Managed[E1, R])(implicit ev: NeedsEnv[R]): Managed[E1, A]

    Permalink

    Uses the given Managed[E1, R] to the environment required to run this managed effect, leaving no outstanding environments and returning Managed[E1, A]

    Uses the given Managed[E1, R] to the environment required to run this managed effect, leaving no outstanding environments and returning Managed[E1, A]

    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use provideLayer

  5. def provideSomeM[R0, E1 >: E](r0: ZIO[R0, E1, R])(implicit ev: NeedsEnv[R]): ZManaged[R0, E1, A]

    Permalink

    An effectful version of provideSome, useful when the act of partial provision requires an effect.

    An effectful version of provideSome, useful when the act of partial provision requires an effect.

    val managed: ZManaged[Console with Logging, Nothing, Unit] = ???
    
    val r0: URIO[Console, Console with Logging] = ???
    
    managed.provideSomeM(r0)
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use provideSomeLayer

  6. def provideSomeManaged[R0, E1 >: E](r0: ZManaged[R0, E1, R])(implicit ev: NeedsEnv[R]): ZManaged[R0, E1, A]

    Permalink

    Uses the given ZManaged[R0, E1, R] to provide some of the environment required to run this effect, leaving the remainder R0.

    Uses the given ZManaged[R0, E1, R] to provide some of the environment required to run this effect, leaving the remainder R0.

    val managed: ZManaged[Console with Logging, Nothing, Unit] = ???
    
    val r0: ZManaged[Console, Nothing, Console with Logging] = ???
    
    managed.provideSomeManaged(r0)
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) use provideSomeLayer

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped