akka.actor

ScalaActorRef

trait ScalaActorRef extends ActorRefShared with ForwardableChannel with ReplyChannel[Any]

This trait represents the Scala Actor API There are implicit conversions in ../actor/Implicits.scala from ActorRef -> ScalaActorRef and back

Self Type
ScalaActorRef with ActorRef
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ScalaActorRef
  2. ReplyChannel
  3. ForwardableChannel
  4. AvailableChannel
  5. UntypedChannel
  6. Channel
  7. Channel
  8. ActorRefShared
  9. AnyRef
  10. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. def channel : UntypedChannel

    Get channel by which this channel would reply (used by ActorRef.

    Get channel by which this channel would reply (used by ActorRef.forward)

    Attributes
    abstract
    Definition Classes
    ForwardableChannel
  2. def id : String

    Identifier for actor, does not have to be a unique one.

    Identifier for actor, does not have to be a unique one. Default is the 'uuid'.

    This field is used for logging, AspectRegistry.actorsFor(id), identifier for remote actor in RemoteServer etc.But also as the identifier for persistence, which means that you can use a custom name to be able to retrieve the "correct" persisted state upon restart, remote restart etc.

    Attributes
    abstract
  3. def id_= (id: String): Unit

    Attributes
    abstract
  4. def uuid : Uuid

    Returns the uuid for the actor.

    Returns the uuid for the actor.

    Attributes
    abstract
    Definition Classes
    ActorRefShared

Concrete Value Members

  1. def ! (message: Any)(implicit channel: UntypedChannel = NullChannel): Unit

    Sends a one-way asynchronous message.

    Sends a one-way asynchronous message. E.g. fire-and-forget semantics.

    If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument.

    This actor 'sender' reference is then available in the receiving actor in the 'sender' member variable, if invoked from within an Actor. If not then no sender is available.

      actor ! message
    

    Definition Classes
    ScalaActorRefChannel
  2. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  3. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  4. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  5. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  6. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  7. def ? (message: Any)(implicit channel: UntypedChannel = NullChannel, timeout: Timeout = Actor.defaultTimeout): ActorCompletableFuture

    Sends a message asynchronously, returning a future which may eventually hold the reply.

    Sends a message asynchronously, returning a future which may eventually hold the reply. Is pronounced: "ask"

  8. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  9. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  11. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. var faultHandler : FaultHandlingStrategy

    User overridable callback/setting.

    User overridable callback/setting.

    Don't forget to supply a List of exception types to intercept (trapExit)

    Can be one of:

     faultHandler = AllForOneStrategy(trapExit = List(classOf[Exception]), maxNrOfRetries, withinTimeRange)
    
    Or:
     faultHandler = OneForOneStrategy(trapExit = List(classOf[Exception]), maxNrOfRetries, withinTimeRange)
    

  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def forward (message: Any)(implicit channel: ForwardableChannel): Unit

    Forwards the message and passes the original sender actor as the sender.

    Forwards the message and passes the original sender actor as the sender.

    Works with '!', '!!' and '!!!'.

  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  16. def getFaultHandler (): FaultHandlingStrategy

  17. def getLifeCycle (): LifeCycle

  18. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  19. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  20. var lifeCycle : LifeCycle

    User overridable callback/setting.

    User overridable callback/setting.

    Defines the life-cycle for a supervised actor.

  21. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  22. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  23. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  24. def sendException (ex: Throwable): Boolean

    Try to send an exception.

    Try to send an exception. Not all channel types support this, one notable positive example is Future. Failure to send is silent.

    returns

    whether sending was successful

    Definition Classes
    Channel
  25. def sender : Option[ActorRef]

    The reference sender Actor of the last received message.

    The reference sender Actor of the last received message. Is defined if the message was sent from another Actor, else None.

  26. def senderFuture (): Option[CompletableFuture[Any]]

    The reference sender future of the last received message.

    The reference sender future of the last received message. Is defined if the message was sent with sent with '!!' or '!!!', else None.

  27. def setFaultHandler (arg0: FaultHandlingStrategy): Unit

    User overridable callback/setting.

    User overridable callback/setting.

    Don't forget to supply a List of exception types to intercept (trapExit)

    Can be one of:

     faultHandler = AllForOneStrategy(trapExit = List(classOf[Exception]), maxNrOfRetries, withinTimeRange)
    
    Or:
     faultHandler = OneForOneStrategy(trapExit = List(classOf[Exception]), maxNrOfRetries, withinTimeRange)
    

  28. def setLifeCycle (arg0: LifeCycle): Unit

    User overridable callback/setting.

    User overridable callback/setting.

    Defines the life-cycle for a supervised actor.

  29. def spawn [T <: Actor] (implicit arg0: Manifest[T]): ActorRef

    Atomically create (from actor class) and start an actor.

  30. def spawnLink [T <: Actor] (implicit arg0: Manifest[T]): ActorRef

    Atomically create (from actor class), start and link an actor.

  31. def spawnLinkRemote [T <: Actor] (hostname: String, port: Int, timeout: Long)(implicit arg0: Manifest[T]): ActorRef

    Atomically create (from actor class), start, link and make an actor remote.

  32. def spawnRemote [T <: Actor] (hostname: String, port: Int, timeout: Long)(implicit arg0: Manifest[T]): ActorRef

    Atomically create (from actor class), start and make an actor remote.

  33. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  34. def tell (msg: Any, sender: UntypedChannel): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.tell(message, context);
    

    Definition Classes
    Channel
  35. def tell (msg: Any): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics.

    actor.tell(message);
    

    Definition Classes
    Channel
  36. def toString (): String

    Definition Classes
    AnyRef → Any
  37. def tryTell (msg: Any)(implicit sender: UntypedChannel): Boolean

    Scala and Java API.

    Scala and Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    From Java:

    actor.tryTell(message);
    actor.tryTell(message, context);
    

    From Scala:

    actor tryTell message
    actor.tryTell(message)(sender)
    

    Definition Classes
    Channel
  38. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  39. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  40. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def !! (message: Any, timeout: Long = this.timeout)(implicit channel: UntypedChannel = NullChannel): Option[Any]

    Sends a message asynchronously and waits on a future for a reply message.

    Sends a message asynchronously and waits on a future for a reply message.

    It waits on the reply either until it receives it (in the form of Some(replyMessage)) or until the timeout expires (which will return None). E.g. send-and-receive-eventually semantics.

    NOTE: Use this method with care. In most cases it is better to use '!' together with the 'sender' member field to implement request/response message exchanges. If you are sending messages using !! then you have to use self.reply(..) to send a reply message to the original sender. If not then the sender will block until the timeout expires.

    Annotations
    @deprecated
    Deprecated

    use (actor ? msg).as[T] instead

  2. def !!! [T] (message: Any, timeout: Long = this.timeout)(implicit channel: UntypedChannel = NullChannel): Future[T]

    Sends a message asynchronously returns a future holding the eventual reply message.

    Sends a message asynchronously returns a future holding the eventual reply message.

    NOTE: Use this method with care. In most cases it is better to use '!' together with the 'sender' member field to implement request/response message exchanges. If you are sending messages using !!! then you have to use self.reply(..) to send a reply message to the original sender. If not then the sender will block until the timeout expires.

    Annotations
    @deprecated
    Deprecated

    return type is an illusion, use the more honest ? method

  3. def reply_? (message: Any): Boolean

    Use reply_?(..) to reply with a message to the original sender of the message currently being processed.

    Use reply_?(..) to reply with a message to the original sender of the message currently being processed.

    Returns true if reply was sent, and false if unable to determine what to reply to.

    Annotations
    @deprecated
    Deprecated

    Use tryReply(..)

  4. def sendOneWay (msg: Any, sender: UntypedChannel): Unit

    Java API.

    Java API.

    Sends the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.sendOneWay(message, context);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tell' instead

  5. def sendOneWay (msg: Any): Unit

    Sends the specified message to the channel, i.

    Sends the specified message to the channel, i.e. fire-and-forget semantics.

    actor.sendOneWay(message);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tell' instead

  6. def sendOneWaySafe (msg: Any, sender: UntypedChannel): Boolean

    Java API.

    Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics, including the sender reference if possible (not supported on all channels).

    actor.sendOneWay(message, context);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tryTell' instead

  7. def sendOneWaySafe (msg: Any): Boolean

    Java API.

    Java API.

    Try to send the specified message to the channel, i.e. fire-and-forget semantics.

    actor.sendOneWay(message);
    

    Definition Classes
    Channel
    Annotations
    @deprecated
    Deprecated

    Use 'tryTell' instead

Inherited from ReplyChannel[Any]

Inherited from ForwardableChannel

Inherited from AvailableChannel[Any]

Inherited from UntypedChannel

Inherited from Channel[Any]

Inherited from Channel[Any]

Inherited from ActorRefShared

Inherited from AnyRef

Inherited from Any