Nexus API Reference

ChannelActorRegistry
in package

FinalYes
Tags
psalm-api

Spawns and caches one channel actor per stable name. Cached refs are validated against isAlive() on every lookup, so a channel actor that stopped itself (e.g. after the last WS connection closed) is silently pruned and the next connect spawns a fresh one — no per-game leak.

A cardinality cap bounds the number of LIVE channel actors: churning unique keys past the cap is refused with ChannelCapacityExceededException rather than spawning actors, refs, and mailboxes without limit (SEC-002). Dead entries are pruned before the cap is enforced, so honest churn that stops channels on last-close never trips it. Used by WebSocketDispatcher; not part of the user-facing API.

Table of Contents

Constants

DEFAULT_MAX_CHANNELS  : int = 10000
Default maximum number of simultaneously live channel actors.

Methods

__construct()  : mixed
count()  : int
Number of currently tracked (not yet pruned) channel actors.
remove()  : void
resolveOrSpawn()  : ActorRef

Constants

DEFAULT_MAX_CHANNELS

Default maximum number of simultaneously live channel actors.

public int DEFAULT_MAX_CHANNELS = 10000

Methods

__construct()

public __construct(ActorSystem $system[, LoggerInterface|null $logger = null ][, int $maxChannels = self::DEFAULT_MAX_CHANNELS ]) : mixed
Parameters
$system : ActorSystem
$logger : LoggerInterface|null = null
$maxChannels : int = self::DEFAULT_MAX_CHANNELS

count()

Number of currently tracked (not yet pruned) channel actors.

public count() : int
Return values
int
On this page

Search results