StartedApp
in package
A started application: the live {@see ActorSystem} plus a registry of the root actor handles spawned from {@see NexusApp}'s definitions, keyed by name.
Returned by NexusApp::start() and passed to the NexusApp::onStart()
callback so callers can retrieve typed handles to root actors — start() used to
discard the spawned refs, forcing real applications to bypass the DSL. Roots are
registered in definition order, which is also their spawn order, so a later root
can be wired to an earlier one via ref().
Owns shutdown: call run() to block on the runtime loop or shutdown() to drain gracefully.
Tags
Table of Contents
Methods
- __construct() : mixed
- has() : bool
- ref() : ActorRef<string|int, object>
- The handle for the root actor registered under $name.
- refs() : array<string, ActorRef<string|int, object>>
- All root actor handles keyed by name, in spawn order.
- run() : void
- Start the runtime event loop, blocking until the system is shut down.
- shutdown() : void
- Drain the system gracefully within the given deadline.
- system() : ActorSystem
Methods
__construct()
public
__construct(ActorSystem $system, array<string, ActorRef<string|int, object>> $refs) : mixed
Parameters
- $system : ActorSystem
- $refs : array<string, ActorRef<string|int, object>>
-
root actor handles keyed by registered name, in spawn order
has()
public
has(string $name) : bool
Parameters
- $name : string
Return values
boolref()
The handle for the root actor registered under $name.
public
ref(string $name) : ActorRef<string|int, object>
Parameters
- $name : string
Tags
Return values
ActorRef<string|int, object>refs()
All root actor handles keyed by name, in spawn order.
public
refs() : array<string, ActorRef<string|int, object>>
Return values
array<string, ActorRef<string|int, object>>run()
Start the runtime event loop, blocking until the system is shut down.
public
run() : void
shutdown()
Drain the system gracefully within the given deadline.
public
shutdown(Duration $timeout) : void
Parameters
- $timeout : Duration
system()
public
system() : ActorSystem