abstract class ActorSystem[-T] extends ActorRef[T] with Extensions with ClassicActorSystemProvider

An ActorSystem is home to a hierarchy of Actors. It is created using ActorSystem#apply from a Behavior object that describes the root Actor of this hierarchy and which will create all other Actors beneath it. A system also implements the ActorRef type, and sending a message to the system directs that message to the root Actor.

Not for user extension.

Self Type
ActorSystem[T] with InternalRecipientRef[T]
Annotations
@DoNotInherit()
Source
ActorSystem.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ActorSystem
  2. ClassicActorSystemProvider
  3. Extensions
  4. ActorRef
  5. Serializable
  6. Comparable
  7. RecipientRef
  8. AnyRef
  9. Any
Implicitly
  1. by ActorRefOps
  2. by RecipientRefOps
  3. by any2stringadd
  4. by StringFormat
  5. by Ensuring
  6. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ActorSystem()

Abstract Value Members

  1. abstract def address: Address

    Obtains the external address of the default transport.

    Obtains the external address of the default transport.

    Consider differences in clustered and non-clustered ActorSystems. For a non-clustered ActorSystem, this will return an address without host and port. For a clustered ActorSystem, this will return the address that other nodes can use to communicate with this node.

  2. abstract def classicSystem: actor.ActorSystem

    Allows access to the classic org.apache.pekko.actor.ActorSystem even for org.apache.pekko.actor.typed.ActorSystem[_]s.

    Allows access to the classic org.apache.pekko.actor.ActorSystem even for org.apache.pekko.actor.typed.ActorSystem[_]s.

    Definition Classes
    ClassicActorSystemProvider
  3. abstract def compareTo(arg0: ActorRef[_]): Int
    Definition Classes
    Comparable
  4. abstract def deadLetters[U]: ActorRef[U]

    The deadLetter address is a destination that will accept (and discard) every message sent to it.

  5. abstract def dispatchers: Dispatchers

    Facilities for lookup up thread-pools from configuration.

  6. abstract def dynamicAccess: DynamicAccess

    ClassLoader wrapper which is used for reflective accesses internally.

    ClassLoader wrapper which is used for reflective accesses internally. This is set to use the context class loader, if one is set, or the class loader which loaded the ActorSystem implementation. The context class loader is also set on all threads created by the ActorSystem, if one was set during creation.

  7. implicit abstract def executionContext: ExecutionContextExecutor

    The default thread pool of this ActorSystem, configured with settings in pekko.actor.default-dispatcher.

  8. abstract def extension[T <: Extension](ext: ExtensionId[T]): T

    Returns the payload that is associated with the provided extension throws an IllegalStateException if it is not registered.

    Returns the payload that is associated with the provided extension throws an IllegalStateException if it is not registered. This method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution

    Definition Classes
    Extensions
  9. abstract def getWhenTerminated: CompletionStage[Done]

    Java API: Returns a CompletionStage which will be completed after the ActorSystem has been terminated and termination hooks have been executed.

    Java API: Returns a CompletionStage which will be completed after the ActorSystem has been terminated and termination hooks have been executed. The ActorSystem can be stopped with ActorSystem.terminate or by stopping the guardian actor.

    Be careful to not schedule any operations, such as thenRunAsync, on the dispatchers (Executor) of this actor system as they will have been shut down before this CompletionStage completes.

  10. abstract def hasExtension(ext: ExtensionId[_ <: Extension]): Boolean

    Returns whether the specified extension is already registered, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution

    Returns whether the specified extension is already registered, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution

    Definition Classes
    Extensions
  11. abstract def ignoreRef[U]: ActorRef[U]

    An ActorRef that ignores any incoming messages.

  12. abstract def log: Logger

    A org.slf4j.Logger that can be used to emit log messages without specifying a more detailed source.

    A org.slf4j.Logger that can be used to emit log messages without specifying a more detailed source. Typically it is desirable to use the dedicated Logger available from each Actor’s TypedActorContext as that ties the log entries to the actor.

  13. abstract def logConfiguration(): Unit

    Log the configuration.

  14. abstract def name: String

    The name of this actor system, used to distinguish multiple ones within the same JVM & class loader.

  15. abstract def narrow[U <: T]: ActorRef[U]

    Narrow the type of this ActorRef, which is always a safe operation.

    Narrow the type of this ActorRef, which is always a safe operation.

    Definition Classes
    ActorRef
  16. abstract def path: ActorPath

    The hierarchical path name of the referenced Actor.

    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.

    Definition Classes
    ActorRef
  17. abstract def printTree: String

    Create a string representation of the actor hierarchy within this system for debugging purposes.

    Create a string representation of the actor hierarchy within this system for debugging purposes.

    The format of the string is subject to change, i.e. no stable “API”.

  18. abstract def registerExtension[T <: Extension](ext: ExtensionId[T]): T

    Registers the provided extension and creates its payload, if this extension isn't already registered This method has putIfAbsent-semantics, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution

    Registers the provided extension and creates its payload, if this extension isn't already registered This method has putIfAbsent-semantics, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution

    Definition Classes
    Extensions
  19. abstract def scheduler: Scheduler

    A generic scheduler that can initiate the execution of tasks after some delay.

    A generic scheduler that can initiate the execution of tasks after some delay. It is recommended to use the ActorContext’s scheduling capabilities for sending messages to actors instead of registering a Runnable for execution using this facility.

  20. abstract def settings: Settings

    The core settings extracted from the supplied configuration.

  21. abstract def startTime: Long

    Start-up time in milliseconds since the epoch.

  22. abstract def systemActorOf[U](behavior: Behavior[U], name: String, props: Props = Props.empty): ActorRef[U]

    Create an actor in the "/system" namespace.

    Create an actor in the "/system" namespace. This actor will be shut down during system.terminate only after all user actors have terminated.

    This is only intended to be used by libraries (and Pekko itself). Applications should use ordinary spawn.

  23. abstract def tell(msg: T): Unit

    Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.

    Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.

    Definition Classes
    ActorRefRecipientRef
  24. abstract def terminate(): Unit

    Terminates this actor system by running pekko.actor.CoordinatedShutdown with reason pekko.actor.CoordinatedShutdown.ActorSystemTerminateReason.

    Terminates this actor system by running pekko.actor.CoordinatedShutdown with reason pekko.actor.CoordinatedShutdown.ActorSystemTerminateReason.

    If pekko.coordinated-shutdown.run-by-actor-system-terminate is configured to off it will not run CoordinatedShutdown, but the ActorSystem and its actors will still be terminated.

    This will stop the guardian actor, which in turn will recursively stop all its child actors, and finally the system guardian (below which the logging actors reside).

    This is an asynchronous operation and completion of the termination can be observed with ActorSystem.whenTerminated or ActorSystem.getWhenTerminated.

  25. abstract def threadFactory: ThreadFactory

    A ThreadFactory that can be used if the transport needs to create any Threads

  26. abstract def unsafeUpcast[U >: T]: ActorRef[U]

    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.

    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 java.lang.ClassCastException when you send a message to the widened ActorRef[U].

    Definition Classes
    ActorRef
  27. abstract def uptime: Long

    Up-time of this actor system in seconds.

  28. abstract def whenTerminated: Future[Done]

    Scala API: Returns a Future which will be completed after the ActorSystem has been terminated.

    Scala API: Returns a Future which will be completed after the ActorSystem has been terminated. The ActorSystem can be stopped with ActorSystem.terminate or by stopping the guardian actor.

    Be careful to not schedule any operations, such as onComplete, on the dispatchers (ExecutionContext) of this actor system as they will have been shut down before this future completes.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toany2stringadd[ActorSystem[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ActorSystem[T], B)
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toArrowAssoc[ActorSystem[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def ensuring(cond: (ActorSystem[T]) => Boolean, msg: => Any): ActorSystem[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toEnsuring[ActorSystem[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (ActorSystem[T]) => Boolean): ActorSystem[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toEnsuring[ActorSystem[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): ActorSystem[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toEnsuring[ActorSystem[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): ActorSystem[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toEnsuring[ActorSystem[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def eventStream: ActorRef[Command]

    Main event bus of this actor system, used for example for logging.

    Main event bus of this actor system, used for example for logging. Accepts pekko.actor.typed.eventstream.EventStream.Command.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. def receptionist: ActorRef[Command]

    Return a reference to this system’s pekko.actor.typed.receptionist.Receptionist.

  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Shadowed Implicit Value Members

  1. def !(msg: T): Unit

    Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.

    Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.

    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toActorRefOps[T] performed by method ActorRefOps in org.apache.pekko.actor.typed.ActorRef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (actorSystem: ActorRefOps[T]).!(msg)
    Definition Classes
    ActorRefOps
  2. def !(msg: T): Unit

    Send a message to the destination referenced by this RecipientRef using *at-most-once* messaging semantics.

    Send a message to the destination referenced by this RecipientRef using *at-most-once* messaging semantics.

    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toRecipientRefOps[T] performed by method RecipientRefOps in org.apache.pekko.actor.typed.RecipientRef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (actorSystem: RecipientRefOps[T]).!(msg)
    Definition Classes
    RecipientRefOps
  3. val ref: ActorRef[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toActorRefOps[T] performed by method ActorRefOps in org.apache.pekko.actor.typed.ActorRef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (actorSystem: ActorRefOps[T]).ref
    Definition Classes
    ActorRefOps
  4. val ref: RecipientRef[T]
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toRecipientRefOps[T] performed by method RecipientRefOps in org.apache.pekko.actor.typed.RecipientRef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (actorSystem: RecipientRefOps[T]).ref
    Definition Classes
    RecipientRefOps

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toStringFormat[ActorSystem[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (ActorSystem[T], B)
    Implicit
    This member is added by an implicit conversion from ActorSystem[T] toArrowAssoc[ActorSystem[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Extensions

Inherited from ActorRef[T]

Inherited from Serializable

Inherited from Comparable[ActorRef[_]]

Inherited from RecipientRef[T]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion ActorRefOps fromActorSystem[T] to ActorRefOps[T]

Inherited by implicit conversion RecipientRefOps fromActorSystem[T] to RecipientRefOps[T]

Inherited by implicit conversion any2stringadd fromActorSystem[T] to any2stringadd[ActorSystem[T]]

Inherited by implicit conversion StringFormat fromActorSystem[T] to StringFormat[ActorSystem[T]]

Inherited by implicit conversion Ensuring fromActorSystem[T] to Ensuring[ActorSystem[T]]

Inherited by implicit conversion ArrowAssoc fromActorSystem[T] to ArrowAssoc[ActorSystem[T]]

Ungrouped