trait EffectTunnel[F[_], G[_]] extends AnyRef
Type class for disguising the effect of F
in the effect of G
temporarily
so that F
's effect can tunnel through an API that supports only G
.
For example, let F
be com.digitalasset.canton.lifecycle.FutureUnlessShutdown,
and G
be scala.concurrent.Future (see
com.digitalasset.canton.tracing.EffectTunnel.effectTunnelFutureUnlessShutdown).
Then we can enter the tunnel G
by converting
com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdowns
into a dedicated exception in a failed scala.concurrent.Future and exit the tunnel
again by converting the exception back into com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown.
This obviously assumes that the API that supports only scala.concurrent.Future
does not interact with the dedicated exception.
- Alphabetic
- By Inheritance
- EffectTunnel
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def enter[A](fa: F[A]): G[A]
Converts the effect
F
into the effectG
.Converts the effect
F
into the effectG
. Must be the right-inverse of exit, i.e.,exit(enter(fa)) == fa
. - abstract def exit[A](fa: G[A]): F[A]
Converts the effect
G
into the effectF
.Converts the effect
G
into the effectF
. Must be the left-inverse of enter, i.e.,exit(enter(fa)) == fa
.
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
- def andThen[H[_]](tunnel: EffectTunnel[G, H]): EffectTunnel[F, H]
Composes this effect tunnel with another effect tunnel.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exitK: ~>[G, F]
exit as an arrow
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- 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
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- 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])