Nexus API Reference

LogActor
in package
implements StatefulActorHandler

Read onlyYes
FinalYes
Tags
psalm-api

Drains Record messages from its mailbox and dispatches each to the configured handlers. Per-handler exceptions are caught and written to STDERR — the actor must never crash on a sink failure, because a crash would lose any records sitting behind it in the mailbox.

State is the immutable handler list. The list is supplied via the Props factory at spawn time and never mutates.

implements

StatefulActorHandler<object, list<Handler>>

Table of Contents

Interfaces

StatefulActorHandler

Methods

__construct()  : mixed
handle()  : BehaviorWithState<T, S>
Handle an incoming message with the current state.
initialState()  : S
Provide the initial state for this actor.

Methods

__construct()

public __construct(array<int, Handler$handlers) : mixed
Parameters
$handlers : array<int, Handler>

handle()

Handle an incoming message with the current state.

public handle(ActorContext $ctx, object $message, mixed $state) : BehaviorWithState<T, S>
Parameters
$ctx : ActorContext
$message : object
$state : mixed
Tags
psalm-suppress

BlockingCallInHandler — fwrite to STDERR is the intentional last-resort fallback when a Handler itself throws. The actor must not crash here; losing a log line is preferable to dropping every record sitting behind it in the mailbox.

psalm-suppress

MixedReturnTypeCoercion — BehaviorWithState::same() returns a parametrically-loose value that psalm cannot tighten to our specific <object, list<Handler>> binding.

Return values
BehaviorWithState<T, S>

initialState()

Provide the initial state for this actor.

public initialState() : S
Return values
S

        
On this page

Search results