Nexus API Reference

Application

Table of Contents

Interfaces

ClusterTransport
NodeDirectory
ActorContext
Runtime context injected into every actor handler invocation.
ActorHandler
ActorPathContract
Common contract for local and remote actor paths.
ActorRef
Type-safe reference to an actor — the only handle user code holds.
BackpressureCapable
An ActorRef whose sends can report mailbox admission.
StashBuffer
StatefulActorHandler
TimerScheduler
UntracedMessage
Signal
Marker interface for actor lifecycle signals.
SystemMessage
Channel
ConnectionFactory
ActorSpawner
Minimal interface for spawning named actors.
EntityReplayPolicy
EntityManagerFactory
PoolSingletonSpawner
ParamResolver
AuthorizationEnforcer
AuthorizationRequirement
HttpServerAdapter
Authenticator
Authorizer
Principal
TokenExtractor
HealthCheck
Application
CompiledApplication
ConnectionTable
WebSocketContext
Runtime context for an active WebSocket connection.
Formatter
Handler
RecordProcessor
ContextPropagator
Counter
Histogram
Meter
ObservableGauge
UpDownCounter
Observability
Span
Tracer
ExportCommand
EventStore
Read/write interface for event-sourced event streams.
SnapshotStore
DurableStateStore
FutureSlot
FutureException
FutureTimeoutException
Mailbox
Cancellable
Runtime
Abstraction over the concurrency backend that powers the actor system.
EnvelopeSerializer
MessageSerializer
WorkerDirectory
WorkerTransport
WorkerStartHandler

Classes

ActorDefinition
ActorRegistry
AsActor
ActorCommand
UnknownRootActorException
Thrown by {@see \Monadial\Nexus\App\StartedApp::ref()} when no root actor was registered under the requested name.
NexusApp
Fluent bootstrap entry point for Nexus actor applications.
StartedApp
A started application: the live {@see ActorSystem} plus a registry of the root actor handles spawned from {@see NexusApp}'s definitions, keyed by name.
NodeAddress
NodeHashRing
AbstractActor
ActorCell
ActorPath
ActorSystem
Top-level container and entry point for spawning actors and driving the event loop.
ReplyType
Behavior
Immutable behavior definition — the heart of every actor.
BehaviorWithState
Result type returned from a stateful actor handler.
DeadLetterRef
DefaultStashBuffer
DefaultTimerScheduler
EmptyBehavior
Immutable behavior definition — the heart of every actor.
FutureRef
LocalActorPath
Explicit local actor path wrapper.
LocalActorRef
NullDispatcher
Props
Immutable spawn configuration for an actor.
ReceiveBehavior
Immutable behavior definition — the heart of every actor.
RemoteActorPath
Remote actor path with explicit cluster address plus local actor path.
SameBehavior
Immutable behavior definition — the heart of every actor.
SetupBehavior
Immutable behavior definition — the heart of every actor.
StoppedBehavior
Immutable behavior definition — the heart of every actor.
SupervisedBehavior
Immutable behavior definition — the heart of every actor.
TaskContext
UnhandledBehavior
Immutable behavior definition — the heart of every actor.
UnstashAllBehavior
Immutable behavior definition — the heart of every actor.
WithStashBehavior
Immutable behavior definition — the heart of every actor.
WithStateBehavior
Immutable behavior definition — the heart of every actor.
WithTimersBehavior
Immutable behavior definition — the heart of every actor.
MessageDeadLettered
PSR-14 event dispatched whenever a message reaches the dead-letter sink — an undeliverable, unhandled, or dropped message. Subscribe to observe delivery failures without polling the bounded sample buffer.
ActorException
ActorInitializationException
ActorNameExistsException
AskTimeoutException
AskUndeliverableException
InvalidActorPathException
InvalidActorStateTransition
InvalidBehaviorException
InvalidPropsFactoryException
MaxRetriesExceededException
NexusException
NexusLogicException
NoSenderException
StashOverflowException
UnsupportedSupervisionStrategyException
Thrown at spawn when an actor is configured with a supervision strategy that the current runtime does not honor, rather than silently degrading to a different one.
ChildFailed
PostRestart
PostStop
PreRestart
PreStart
ReceiveTimeout
Lifecycle signal delivered to an actor when no user message has arrived within the duration configured via ActorContext::setReceiveTimeout().
Terminated
Envelope
Immutable message wrapper that carries a user message through the mailbox system.
ChildFailedNotification
ChildTerminated
DeadLetter
Kill
PoisonPill
Resume
Suspend
Unwatch
Watch
WatcheeTerminated
Host
Port
SupervisionStrategy
ActorPoolBinding
Ergonomic carrier for injecting a ConnectionPool into actors via Props::fromFactory().
DoctrineBootstrap
Enables Swoole coroutine hooks for Doctrine DBAL drivers. Idempotent.
DoctrinePool
ConnectionCreated
ConnectionDestroyed
ConnectionPoisoned
ConnectionReleased
ConnectionTaken
PoolExhausted
ConnectionPoisonedException
MissingConnectionScopeException
MissingTransactionalDependencyException
PoolClosedException
PoolExhaustedException
FiberChannel
Non-blocking, single-fiber channel backed by SplQueue. `pop()` ignores the timeout — under FiberRuntime PDO will block the fiber anyway, so adding a coroutine-style suspend here is pointless.
SwooleChannel
Coroutine-aware bounded channel. `pop()` suspends the current coroutine until either an item is pushed or the timeout elapses.
ConnectionPool
DriverManagerConnectionFactory
Evictor
LeakDetector
PoolConfig
PoolStats
OrmActorPoolBinding
Carries both connection and EM pool. Composes Plan 1's DBAL-only binding via a `base` field so DBAL stays independent of the ORM package.
ActorSystemSpawner
Wires a Nexus ActorSystem into the ActorSpawner interface used by EntityRefFactory.
EntityBehavior
EntityBehaviorBuilder
EntityBehaviorRunner
EntityEffect
EntityRefFactory
Spawns and caches one ActorRef per entity identity, enforcing a single writer per entity within an ActorSystem. Subsequent calls to of() with the same id return the cached ref.
EntityRefFactoryBuilder
CreateIfMissing
FailIfMissing
OnDemand
DoctrineEmPool
EntityManagerCleared
EntityManagerCreated
EntityManagerEvicted
EntityConflictException
MissingEntityManagerScopeException
DefaultEntityManagerFactory
EmPoolConfig
EmPoolStats
EntityManagerPool
PooledEntityManager
ActorRegistrationEntry
ActorRegistry
PerRequestActorScope
RequestScopeGuardian
ResolvedActorTable
CompiledHttpApp
Immutable, ready-to-serve PSR-15 request handler produced by {@see HttpApp::compile()}.
RouteCachePersister
RouteDiscoverer
ActorRegistration
HttpApp
Fluent DSL entry point for building a Nexus HTTP application.
RouteBuilder
Fluent per-route configuration builder returned by HTTP verb methods.
RouteGroup
RequestCompleted
RequestStarted
RouteMatched
ActorShorthandHandlerException
DefaultMappers
DuplicateActorNameException
DuplicateRouteNameException
ExceptionMapperRegistry
GenericHttpException
GlobalAuthorizationMiddlewareException
HttpAppAlreadyCompiledException
HttpException
InvalidFromActorParameterException
MethodNotAllowedException
PerRequestActorInConstructorException
PerRequestScopeDisposedException
PoolSingletonRequiresSpawnerException
RouteNotFoundException
UnknownActorException
UnprotectedRouteException
FromActor
FromBody
FromService
HandlerMetadata
HandlerResolver
ResolvedHandler
ContainerFallbackResolver
FromActorResolver
FromBodyResolver
FromServiceResolver
PathParamResolver
PerRequestScopeResolver
ServerRequestResolver
CompileContext
UnresolvableParameterException
HttpBootContext
HttpRequestContext
InvocationContext
ParamMetadata
ParamResolverRegistry
RequestBoundContext
ResolverServices
ExceptionHandlerMiddleware
MiddlewareInvoker
MiddlewarePipeline
MiddlewareResolver
RouterMiddleware
IteratorStream
JsonResponse
Response
StreamingResponse
Route
Dispatcher
DispatchResult
Route
RouteCollection
RouteSummary
RouteProtection
Authorize
FromPrincipal
RequiresAnyRole
RequiresAnyScope
RequiresAuth
PHP attribute that enforces authentication on a route handler class.
RequiresRole
RequiresScope
AuthChallenge
ChainAuthenticator
JwtAuthenticator
StaticTokenAuthenticator
AuthException
AuthMiddlewareNotRegisteredException
AuthorizationMisconfiguredException
Forbidden
InvalidAuthorizerException
Unauthenticated
BearerTokenExtractor
CookieTokenExtractor
HeaderTokenExtractor
AuthenticationMiddleware
PSR-15 middleware that authenticates every inbound request.
AuthMetadata
AuthorizationMiddleware
SimplePrincipal
FromPrincipalResolver
ServerRuntime
SwooleRequestTranslator
SwooleResponseWriter
SwooleServerEventBinder
SwooleStreamingDetector
SwooleConnectionContext
SwooleHttpServerAdapter
SwooleWorkerConfig
SwooleWorkerServer
WorkerServerRuntime
ShutdownSignalHandler
WorkerNodePoolSingletonSpawner
SwooleThreadConfig
SwooleThreadServer
ThreadAwareConnectionContext
ThreadServerRuntime
HealthCheckHandler
HealthCheckRegistry
HealthStatus
LivenessHandler
AccessLogMiddleware
BodySizeLimitMiddleware
OriginAllowlistMiddleware
TraceContextMiddleware
HttpTestClient
TestResponse
CompiledHttpApplication
CompiledWsApplication
EmptyContainer
HttpApplication
FromContext
ChannelActorNameResolver
ChannelActorRegistry
ChannelCapacityExceededException
DuplicateRouteException
UnsupportedRouteException
HandlerInstantiator
HandshakeGate
HandshakeResult
InMemoryConnectionTable
ChannelConnectionClosed
ChannelConnectionOpened
Sent by the dispatcher to a channel actor when a new connection joins.
ChannelMessageReceived
FromContextResolver
WsConnectionContext
WebSocketChannelActor
WebSocketDispatcher
WebSocketFrame
WebSocketHandler
Base class for WebSocket connection handlers; extend to define per-connection behaviour.
WebSocketRoute
WebSocketRouter
WsApplication
JsonFormatter
LineFormatter
ConsoleHandler
FileHandler
HandlerFailureReporter
Last-resort failure sink for the LogActor.
LogActor
Logger
Mdc
MonologFormatterAdapter
MonologHandlerAdapter
NexusLogger
CallerInfoProcessor
Record
ThreadQueueHandler
ObservabilityConfig
Baggage
BaggagePropagator
CompositePropagator
Context
NoopContextPropagator
TraceContextPropagator
NoopCounter
NoopHistogram
NoopMeter
NoopObservableGauge
NoopUpDownCounter
NoopObservability
NoopSpan
NoopTracer
SpanContext
ActorSystemMetrics
DbalPoolMetricsListener
OrmPoolMetricsListener
SqlSpan
TracingConnection
TracingDriver
TracingDriverMiddleware
TracingStatement
HttpMetricsListener
ServerSpanMiddleware
TraceCorrelationProcessor
AttributeKeys
Narrows framework attribute maps (any string keys) to the non-empty-string keys the OpenTelemetry SDK instruments declare. Empty keys are dropped — the OTel specification discards attributes with empty keys anyway.
ActorForwardingLogRecordExporter
ActorForwardingMetricExporter
ActorForwardingSpanExporter
AsyncExportHandles
ExportLogs
ExportMetrics
ExportSpans
FlushNow
OtlpExportActor
SwooleCoroutinePsr18Client
SwooleHttpNetworkException
OtelCounter
OtelHistogram
OtelMeter
OtelObservableGauge
OtelUpDownCounter
ObservabilityFactory
OtelObservability
OtelPsrLogger
OtelSpan
OtelTracer
TracingDurableStateStore
TracingEventStore
TracingSnapshotStore
SwooleAdminMetrics
SwooleContextRegistrar
TracingWorkerTransport
EventEnvelope
InMemoryEventStore
AbstractEventSourcedActor
Class-based OOP alternative to the functional EventSourcedBehavior API.
Effect
Command-handler return type for event-sourced actors.
EventSourcedBehavior
Fluent builder for event-sourced actor behaviors.
PersistenceEngine
Core engine that wraps user command+event handlers into a Behavior with automatic recovery and event persistence.
RetentionPolicy
SnapshotStrategy
ConcurrentModificationException
RecoveryException
WriterConflictException
PersistenceId
Unique stable identity for a persistent actor.
ReplayFilter
Detects interleaved writers during event replay (recovery).
InMemorySnapshotStore
SnapshotEnvelope
AbstractDurableStateActor
Class-based OOP alternative to the functional DurableStateBehavior API.
DurableEffect
DurableStateBehavior
Fluent builder for durable-state actor behaviors.
DurableStateEngine
Core engine that wraps user command handlers into a Behavior with automatic recovery and state persistence.
DurableStateEnvelope
InMemoryDurableStateStore
DbalDurableStateStore
DbalEventStore
DbalSnapshotStore
PersistenceSchemaManager
DoctrineDurableStateStore
DoctrineEventStore
DoctrineSnapshotStore
DurableStateEntry
EventEntry
SnapshotEntry
Future
FutureResult
ImmediateFutureSlot
A FutureSlot that is already settled at construction time.
LazyFutureSlot
A FutureSlot that lazily evaluates a closure on await().
Duration
Nanosecond-precision, immutable duration value object.
FutureCancelledException
InvalidMailboxConfigException
MailboxClosedException
MailboxException
MailboxOverflowException
MailboxTimeoutException
MailboxConfig
Immutable value object configuring the capacity and overflow behaviour of an actor mailbox.
FiberCancellable
FiberFutureSlot
Fiber-based FutureSlot implementation.
FiberMailbox
FiberRuntime
FiberScheduler
TimerEntry
StepCancellable
StepFutureSlot
Deterministic FutureSlot for StepRuntime.
StepMailbox
Deterministic mailbox for the StepRuntime.
StepRuntime
Deterministic runtime for testing.
VirtualClock
DeferredCancellable
Cancellable for timers scheduled before Co\run() starts.
SwooleCancellable
SwooleConfig
SwooleFutureSlot
Swoole-based FutureSlot using a Channel(1) for coroutine suspension.
SwooleMailbox
Swoole-backed mailbox using a Swoole\Coroutine\Channel for message passing.
SwooleRuntime
Swoole coroutine-based runtime.
DefaultEnvelopeSerializer
MessageDeserializationException
MessageSerializationException
SerializationException
MessageType
PhpNativeSerializer
TypeRegistry
ValinorJsonSerializer
ValinorMessageSerializer
ConsistentHashRing
InMemoryWorkerDirectory
WorkerAskAck
WorkerAskCancel
WorkerAskCancelled
WorkerAskReply
WorkerAskRequest
InMemoryWorkerTransport
WorkerReplyRef
WorkerActorRef
WorkerNode
Per-worker coordinator within a local worker pool.
WorkerPoolConfig
DefaultWorkerStartHandler
ThreadMapDirectory
ThreadQueueTransport
WorkerPool
WorkerPoolApp
WorkerPoolBootstrap
WorkerPoolHandle
WorkerRunnable

Traits

ForwardsBatchesToActor
Shared Buffering -> Live -> Direct state machine for the actor-forwarding exporters.

Enums

ActorState
Directive
StrategyType
EntityEffectKind
ActorMode
ErrorMode
Scope
State
Level
SpanKind
StatusCode
EffectType
ReplayFilterMode
DurableEffectType
EnqueueResult
OverflowStrategy
WorkerAskState

Functions

withMailbox()  : callable(Props<string|int, object>): Props<string|int, object>
withSupervision()  : callable(Props<string|int, object>): Props<string|int, object>

Functions

withMailbox()

withMailbox(MailboxConfig $config) : callable(Props<string|int, object>): Props<string|int, object>
Parameters
$config : MailboxConfig
Tags
psalm-api

Pipe-friendly function: applies mailbox config to Props.

Usage with pipe operator: $behavior |> Props::fromBehavior(...) |> withMailbox($config)

Return values
callable(Props<string|int, object>): Props<string|int, object>

withSupervision()

withSupervision(SupervisionStrategy $strategy) : callable(Props<string|int, object>): Props<string|int, object>
Parameters
$strategy : SupervisionStrategy
Tags
psalm-api

Pipe-friendly function: applies supervision strategy to Props.

Usage with pipe operator: $behavior |> Props::fromBehavior(...) |> withSupervision($strategy)

Return values
callable(Props<string|int, object>): Props<string|int, object>
On this page

Search results