Packages

  • package root
    Definition Classes
    root
  • package akka
    Definition Classes
    root
  • package actor
    Definition Classes
    akka
  • object ActorDSL extends actor.dsl.Inbox with Creators

    This object contains elements which make writing actors and related code more concise, e.g.

    This object contains elements which make writing actors and related code more concise, e.g. when trying out actors in the REPL.

    For the communication of non-actor code with actors, you may use anonymous actors tailored to this job:

    import ActorDSL._
    import scala.concurrent.util.duration._
    
    implicit val system: ActorSystem = ...
    
    implicit val i = inbox()
    someActor ! someMsg // replies will go to `i`
    
    val reply = i.receive()
    val transformedReply = i.select(5 seconds) {
      case x: Int => 2 * x
    }

    The receive and select methods are synchronous, i.e. they block the calling thread until an answer from the actor is received or the timeout expires. The default timeout is taken from configuration item akka.actor.dsl.default-timeout.

    When defining actors in the REPL, say, you may want to have a look at the Act trait:

    import ActorDSL._
    
    val system: ActorSystem = ...
    
    val a = actor(system, "fred")(new Act {
        val b = actor("barney")(new Act {
            ...
          })
    
        become {
          case msg => ...
        }
      })

    Note that actor can be used with an implicit akka.actor.ActorRefFactory as shown with "barney" (where the akka.actor.ActorContext serves this purpose), but since nested declarations share the same lexical context "fred"’s ActorContext would be ambiguous if the akka.actor.ActorSystem were declared implicit (this could also be circumvented by shadowing the name system within "fred").

    Note: If you want to use an Act with Stash, you should use the ActWithStash trait in order to have the actor get the necessary deque-based mailbox setting.

    Definition Classes
    actor
  • Act
  • ActWithStash
  • Extension
  • Inbox
  • InboxExtension
o

akka.actor.ActorDSL

Extension

Companion class Extension

object Extension extends ExtensionId[Extension] with ExtensionIdProvider

Attributes
protected
Source
ActorDSL.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Extension
  2. ExtensionIdProvider
  3. ExtensionId
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(system: ActorSystem): Extension

    Returns an instance of the extension identified by this ExtensionId instance.

    Returns an instance of the extension identified by this ExtensionId instance.

    Definition Classes
    ExtensionId
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def createExtension(system: ExtendedActorSystem): Extension

    Is used by Akka to instantiate the Extension identified by this ExtensionId, internal use only.

    Is used by Akka to instantiate the Extension identified by this ExtensionId, internal use only.

    Definition Classes
    ExtensionExtensionId
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. final def equals(other: Any): Boolean
    Definition Classes
    ExtensionId → AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def get(system: ActorSystem): Extension

    Java API: retrieve the ActorDSL extension for the given system.

    Java API: retrieve the ActorDSL extension for the given system.

    Definition Classes
    ExtensionExtensionId
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  13. final def hashCode(): Int
    Definition Classes
    ExtensionId → AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def lookup(): Extension.type

    Returns the canonical ExtensionId for this Extension

    Returns the canonical ExtensionId for this Extension

    Definition Classes
    ExtensionExtensionIdProvider
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ExtensionIdProvider

Inherited from ExtensionId[Extension]

Inherited from AnyRef

Inherited from Any

Ungrouped