trait SwitchablePolicy[E] extends Policy[E]
A Policy that can be replaced safely at runtime
- Alphabetic
- By Inheritance
- SwitchablePolicy
- Policy
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def apply[R, E1 <: E, A](f: ZIO[R, E1, A]): ZIO[R, PolicyError[E1], A]
- Definition Classes
- Policy
- abstract def switch[R0, E0, E2 >: E](newPolicy: ZIO[Scope with R0, E0, Policy[E2]], mode: Mode = Mode.Transition): ZIO[R0, E0, UIO[Unit]]
Switches the policy to the new policy
Switches the policy to the new policy
After completion of this effect, it is guaranteed that new calls are executed with the new policy. Calls in flight before execution of the switch will be completed with the old policy.
The old policy will be released after those in-flight calls are completed. The inner UIO signals completion of release of the old policy.
- newPolicy
The new policy to apply. Can be a policy that accepts a supertype of errors of the original policy.
- mode
Transition mode: Transition = Process new calls with the new policy while completing in-flight calls with the previous policy. FinishInFlight = Wait for completion of in-flight calls with the old policy before accepting
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def compose[E2 <: E](that: Policy[PolicyError[E2]]): Policy[E2]
Apply another policy on top of this one
Apply another policy on top of this one
The other policy gets applied before this policy, i.e. policyA compose policyB means policyB { policyA { effect } }
- that
The other policy
- Definition Classes
- Policy
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)