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 'adaptResponseand
adaptTimeoutmethods.
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
. TheFuture
returning 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 T
adaptResponse(Res response)
T
adaptTimeout()
T
adaptTimeout(java.lang.String msg)
Req
askMessage()
boolean
canEqual(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()
boolean
equals(java.lang.Object x$1)
java.time.Duration
getResponseTimeout()
Java APIint
hashCode()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
void
respondWith(Res response)
java.lang.Class<Res>
responseClass()
scala.concurrent.duration.FiniteDuration
responseTimeout()
RecipientRef<Req>
target()
void
timeout()
java.lang.String
toString()
-
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:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-