Class Effect.AskInitiated<Req,Res,T>
java.lang.Object
org.apache.pekko.actor.testkit.typed.Effect
org.apache.pekko.actor.testkit.typed.Effect.AskInitiated<Req,Res,T>
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
- Enclosing class:
- Effect
public static final class Effect.AskInitiated<Req,Res,T>
extends Effect
implements scala.Product, Serializable
The behavior initiated an ask via its context. A response or timeout may be sent via this
effect to the asking behavior: this effect enforces that at most one response or timeout is
sent. Alternatively, one may, after obtaining the effect, test the response adaptation function
(without sending a message to the asking behavior) arbitrarily many times via the 'adaptResponse
and adaptTimeout methods.
The 'replyToRef' is exposed so that the target inbox can expect the actual message sent to initiate the ask.
Note that this requires the ask to be initiated via the ActorContext. The Future returning
ask is not testable in the BehaviorTestKit.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pekko.actor.testkit.typed.Effect
Effect.AskInitiated<Req,Res, T>, Effect.AskInitiated$, Effect.MessageAdapter<A, T>, Effect.MessageAdapter$, Effect.NoEffects, Effect.NoEffects$, Effect.ReceiveTimeoutCancelled, Effect.ReceiveTimeoutCancelled$, Effect.ReceiveTimeoutSet<T>, Effect.ReceiveTimeoutSet$, Effect.Scheduled<U>, Effect.Scheduled$, Effect.Spawned<T>, Effect.Spawned$, Effect.SpawnedAdapter$, Effect.SpawnedAnonymous<T>, Effect.SpawnedAnonymous$, Effect.SpawnedAnonymousAdapter$, Effect.Stopped, Effect.Stopped$, Effect.TimerCancelled, Effect.TimerCancelled$, Effect.TimerScheduled<U>, Effect.TimerScheduled$, Effect.Unwatched<T>, Effect.Unwatched$, Effect.Watched<T>, Effect.Watched$, Effect.WatchedWith<U, T>, Effect.WatchedWith$ -
Constructor Summary
ConstructorsConstructorDescriptionAskInitiated(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, Class<Res> responseClass, Req askMessage, scala.Function1<scala.util.Try<Res>, scala.runtime.BoxedUnit> forwardResponse, scala.Function1<scala.util.Try<Res>, T> mapResponse) -
Method Summary
Modifier and TypeMethodDescriptionadaptResponse(Res response) adaptTimeout(String msg) boolean<Req,Res, T>
Effect.AskInitiated<Req,Res, T> copy(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, Class<Res> responseClass, Req askMessage, scala.Function1<scala.util.Try<Res>, scala.runtime.BoxedUnit> forwardResponse, scala.Function1<scala.util.Try<Res>, T> mapResponse) <Req,Res, T>
RecipientRef<Req><Req,Res, T>
scala.concurrent.duration.FiniteDuration<Req,Res, T>
Class<Res>booleanJava APIinthashCode()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>voidrespondWith(Res response) scala.concurrent.duration.FiniteDurationtarget()voidtimeout()toString()Methods inherited from class org.apache.pekko.actor.testkit.typed.Effect
timerScheduledMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
AskInitiated
-
-
Method Details
-
target
-
responseTimeout
public scala.concurrent.duration.FiniteDuration responseTimeout() -
responseClass
-
askMessage
-
respondWith
-
timeout
public void timeout() -
adaptResponse
-
adaptTimeout
-
adaptTimeout
-
getResponseTimeout
Java API -
copy
public <Req,Res, Effect.AskInitiated<Req,T> Res, copyT> (RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, Class<Res> responseClass, Req askMessage, scala.Function1<scala.util.Try<Res>, scala.runtime.BoxedUnit> forwardResponse, scala.Function1<scala.util.Try<Res>, T> mapResponse) -
copy$default$1
-
copy$default$2
public <Req,Res, scala.concurrent.duration.FiniteDuration copy$default$2()T> -
copy$default$3
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-