Package akka.actor
Class Inbox
- java.lang.Object
-
- akka.actor.Inbox
-
- Direct Known Subclasses:
Inbox$Inbox
public abstract class Inbox extends java.lang.Object
Receive the next message from this Inbox. This call will return immediately if the internal actor previously received a message, or it will block for up to the specified duration to await reception of a message. If no message is received aTimeoutException
will be raised.
-
-
Constructor Summary
Constructors Constructor Description Inbox()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Inbox
create(ActorSystem system)
abstract ActorRef
getRef()
Obtain a reference to the internal actor, which can then for example be registered with the event stream or whatever else you may want to do with anActorRef
.java.lang.Object
receive(java.time.Duration max)
Receive the next message from this Inbox.abstract java.lang.Object
receive(scala.concurrent.duration.FiniteDuration max)
abstract void
send(ActorRef target, java.lang.Object msg)
Have the internal actor act as the sender of the given message which will be sent to the given target.abstract void
watch(ActorRef target)
Have the internal actor watch the target actor.
-
-
-
Method Detail
-
create
public static Inbox create(ActorSystem system)
-
receive
public abstract java.lang.Object receive(scala.concurrent.duration.FiniteDuration max) throws java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.TimeoutException
-
receive
public java.lang.Object receive(java.time.Duration max) throws java.util.concurrent.TimeoutException
Receive the next message from this Inbox. This call will return immediately if the internal actor previously received a message, or it will block for up to the specified duration to await reception of a message. If no message is received aTimeoutException
will be raised.- Parameters:
max
- (undocumented)- Returns:
- (undocumented)
- Throws:
java.util.concurrent.TimeoutException
-
watch
public abstract void watch(ActorRef target)
Have the internal actor watch the target actor. When the target actor terminates aTerminated
message will be received.- Parameters:
target
- (undocumented)
-
getRef
public abstract ActorRef getRef()
Obtain a reference to the internal actor, which can then for example be registered with the event stream or whatever else you may want to do with anActorRef
.- Returns:
- (undocumented)
-
send
public abstract void send(ActorRef target, java.lang.Object msg)
Have the internal actor act as the sender of the given message which will be sent to the given target. This means that should the target actor reply then those replies will be received by this Inbox.- Parameters:
target
- (undocumented)msg
- (undocumented)
-
-