Class EntityRefImpl<M>

    • Method Detail

      • ask

        public <U> scala.concurrent.Future<U> ask​(scala.Function1<ActorRef<U>,​M> message,
                                                  Timeout timeout)
        Description copied from interface: EntityRef
        Allows to "ask" the EntityRef for a reply. See AskPattern for a complete write-up of this pattern

        Note that if you are inside of an actor you should prefer akka.actor.typed.scaladsl.ActorContext.ask as that provides better safety.

        Example usage:

        
         case class Request(msg: String, replyTo: ActorRef[Reply])
         case class Reply(msg: String)
        
         implicit val timeout = Timeout(3.seconds)
         val target: EntityRef[Request] = ...
         val f: Future[Reply] = target.ask(Request("hello", _))
         

        Please note that an implicit Timeout must be available to use this pattern.

        Specified by:
        ask in interface EntityRef<M>
        Parameters:
        message - (undocumented)
        timeout - (undocumented)
        Returns:
        (undocumented)
      • ask

        public <U> java.util.concurrent.CompletionStage<U> ask​(Function<ActorRef<U>,​M> message,
                                                               Timeout timeout)
        Description copied from class: EntityRef
        Allows to "ask" the EntityRef for a reply. See AskPattern for a complete write-up of this pattern

        Note that if you are inside of an actor you should prefer akka.actor.typed.javadsl.ActorContext.ask as that provides better safety.

        Specified by:
        ask in class EntityRef<M>
        Parameters:
        message - (undocumented)
        timeout - (undocumented)
        Returns:
        (undocumented)
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface InternalRecipientRef<M>
        Returns:
        true if the actor is locally known to be terminated, false if alive or uncertain.
      • tell

        public void tell​(M msg)
        Description copied from class: EntityRef
        Send a message to the entity referenced by this EntityRef using *at-most-once* messaging semantics.
        Specified by:
        tell in interface EntityRef<M>
        Specified by:
        tell in interface RecipientRef<M>
        Specified by:
        tell in class EntityRef<M>
        Parameters:
        msg - (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object