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&rsquo;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 the DeadLetter channel of the pekko.event.EventStream on a best effort basis (i.e. this delivery is not reliable).

    Not for user extension

    • 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:
        tell in interface RecipientRef<T>
      • narrow

        <U extends TActorRef<U> narrow()
        Narrow the type of this ActorRef, 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 use asInstanceOf on the full reference type, which would unfortunately also work on non-ActorRefs. Use it with caution,it may cause a ClassCastException when you send a message to the widened 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 the pekko.actor.ActorPath and 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