Package akka.actor.typed
Interface ActorRef<T>
-
- All Superinterfaces:
java.lang.Comparable<ActorRef<?>>,RecipientRef<T>,java.io.Serializable
- All Known Subinterfaces:
ActorRefImpl<T>
- All Known Implementing Classes:
ActorSystem
public interface ActorRef<T> extends RecipientRef<T>, java.lang.Comparable<ActorRef<?>>, java.io.Serializable
An ActorRef is the identity or address of an Actor instance. It is valid only during the Actor’s lifetime and allows messages to be sent to that Actor instance. Sending a message to an Actor that has terminated before receiving the message will lead to that message being discarded; such messages are delivered to theDeadLetterchannel of theEventStreamon a best effort basis (i.e. this delivery is not reliable).Not for user extension
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classActorRef.ActorRefOps<T>static classActorRef.ActorRefOps$-
Nested classes/interfaces inherited from interface akka.actor.typed.RecipientRef
RecipientRef.RecipientRefOps<T>, RecipientRef.RecipientRefOps$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <U extends T>
ActorRef<U>narrow()Narrow the type of thisActorRef, which is always a safe operation.ActorPathpath()The hierarchical path name of the referenced Actor.voidtell(T msg)Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.<U> ActorRef<U>unsafeUpcast()Unsafe utility method for widening the type accepted by this ActorRef; provided to avoid having to useasInstanceOfon the full reference type, which would unfortunately also work on non-ActorRefs.java.lang.ObjectwriteReplace()
-
-
-
Method Detail
-
tell
void tell(T msg)
Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.- Specified by:
tellin interfaceRecipientRef<T>
-
narrow
<U extends T> ActorRef<U> narrow()
Narrow the type of thisActorRef, which is always a safe operation.
-
unsafeUpcast
<U> ActorRef<U> unsafeUpcast()
Unsafe utility method for widening the type accepted by this ActorRef; provided to avoid having to useasInstanceOfon the full reference type, which would unfortunately also work on non-ActorRefs. Use it with caution,it may cause aClassCastExceptionwhen you send a message to the widened {@link ActorRef[U}].
-
path
ActorPath path()
The hierarchical path name of the referenced Actor. The lifecycle of the ActorRef is fully contained within the lifecycle of theActorPathand more than one Actor instance can exist with the same path at different points in time, but not concurrently.
-
writeReplace
java.lang.Object writeReplace() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
-