Nexus API Reference

StartedApp
in package

Read onlyYes
FinalYes

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
psalm-api

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
bool

ref()

The handle for the root actor registered under $name.

public ref(string $name) : ActorRef<string|int, object>
Parameters
$name : string
Tags
throws
UnknownRootActorException

when no root was registered under $name

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
On this page

Search results