Package akka.actor.testkit.typed
Class Effect.AskInitiated<Req,Res,T>
- java.lang.Object
-
- akka.actor.testkit.typed.Effect
-
- akka.actor.testkit.typed.Effect.AskInitiated<Req,Res,T>
-
- All Implemented Interfaces:
java.io.Serializable,scala.Equals,scala.Product
- Enclosing class:
- Effect
public static final class Effect.AskInitiated<Req,Res,T> extends Effect implements scala.Product, java.io.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 'adaptResponseandadaptTimeoutmethods.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. TheFuturereturning ask is not testable in theBehaviorTestKit.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.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
Constructors Constructor Description AskInitiated(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TadaptResponse(Res response)TadaptTimeout()TadaptTimeout(java.lang.String msg)ReqaskMessage()booleancanEqual(java.lang.Object x$1)<Req,Res,T>
Effect.AskInitiated<Req,Res,T>copy(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, java.lang.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>copy$default$1()<Req,Res,T>
scala.concurrent.duration.FiniteDurationcopy$default$2()<Req,Res,T>
java.lang.Class<Res>copy$default$3()booleanequals(java.lang.Object x$1)java.time.DurationgetResponseTimeout()Java APIinthashCode()intproductArity()java.lang.ObjectproductElement(int x$1)java.lang.StringproductElementName(int x$1)scala.collection.Iterator<java.lang.Object>productIterator()java.lang.StringproductPrefix()voidrespondWith(Res response)java.lang.Class<Res>responseClass()scala.concurrent.duration.FiniteDurationresponseTimeout()RecipientRef<Req>target()voidtimeout()java.lang.StringtoString()-
Methods inherited from class akka.actor.testkit.typed.Effect
timerScheduled
-
-
-
-
Constructor Detail
-
AskInitiated
public AskInitiated(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, java.lang.Class<Res> responseClass, Req askMessage, scala.Function1<scala.util.Try<Res>,scala.runtime.BoxedUnit> forwardResponse, scala.Function1<scala.util.Try<Res>,T> mapResponse)
-
-
Method Detail
-
target
public RecipientRef<Req> target()
-
responseTimeout
public scala.concurrent.duration.FiniteDuration responseTimeout()
-
responseClass
public java.lang.Class<Res> responseClass()
-
askMessage
public Req askMessage()
-
respondWith
public void respondWith(Res response)
-
timeout
public void timeout()
-
adaptTimeout
public T adaptTimeout(java.lang.String msg)
-
adaptTimeout
public T adaptTimeout()
-
getResponseTimeout
public java.time.Duration getResponseTimeout()
Java API
-
copy
public <Req,Res,T> Effect.AskInitiated<Req,Res,T> copy(RecipientRef<Req> target, scala.concurrent.duration.FiniteDuration responseTimeout, java.lang.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
public <Req,Res,T> RecipientRef<Req> copy$default$1()
-
copy$default$2
public <Req,Res,T> scala.concurrent.duration.FiniteDuration copy$default$2()
-
copy$default$3
public <Req,Res,T> java.lang.Class<Res> copy$default$3()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArityin interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElementin interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equalsin interfacescala.Equals- Overrides:
equalsin classjava.lang.Object
-
-