Skip to main content

Reference

Hand-written narrative reference pages for the most-touched classes in Nexus. Each page introduces the class, shows a worked example, and links to the full auto-generated API reference on api.nexusactors.com.

For exhaustive method-by-method documentation of every public class in every package, see api.nexusactors.com.

Front-door classes

These are the classes you will interact with most often when building with Nexus.

Core API

ClassPackageRole
Durationnexus-runtimeImmutable nanosecond-precision duration value object
ActorSystemnexus-coreEntry point — creates, runs, and shuts down an actor system
Behaviornexus-coreImmutable actor message-handler definition
Propsnexus-coreImmutable spawn configuration for an actor
ActorRefnexus-coreType-safe reference to a running actor
ActorContextnexus-coreRuntime context available inside every handler
BehaviorWithStatenexus-coreReturn type for stateful closure handlers

Persistence

ClassPackageRole
PersistenceIdnexus-persistenceUnique identity for a persistent actor
EventSourcedBehaviornexus-persistenceEvent-sourced behavior builder
DurableStateBehaviornexus-persistenceDurable-state behavior builder
Effectnexus-persistenceSide-effect descriptor for event-sourced commands
EventStorenexus-persistenceInterface for reading and writing event streams

Infrastructure

ClassPackageRole
Runtimenexus-runtimeConcurrency backend abstraction (Fiber / Swoole / Step)
MailboxConfignexus-runtimeBounded or unbounded mailbox configuration
Envelopenexus-coreImmutable message wrapper with routing metadata

Lifecycle signals

ClassPackageRole
Signalnexus-coreMarker interface for runtime lifecycle notifications

HTTP

ClassPackageRole
HttpAppnexus-httpFluent DSL entry point for building HTTP applications
RouteBuildernexus-httpPer-route middleware and naming configuration
CompiledHttpAppnexus-httpImmutable PSR-15 handler produced by HttpApp::compile()
WebSocketHandlernexus-http-wsBase class for WebSocket connection handlers
WebSocketContextnexus-http-wsPer-connection context for sending frames and inspecting the upgrade request
AuthenticationMiddlewarenexus-http-authPSR-15 middleware that stamps a Principal onto authenticated requests
RequiresAuthnexus-http-authPHP attribute enforcing authentication (and sibling role/scope attributes)

Scaling

ClassPackageRole
WorkerNodenexus-worker-poolPer-thread coordinator in a Swoole worker pool

Bootstrap

ClassPackageRole
NexusAppnexus-appFluent bootstrap helper for single-process applications

Auto-generated API documentation

The complete method-by-method reference for every public class in every Nexus package is available at api.nexusactors.com. The pages are generated by phpDocumentor from the source docblocks and updated on every release.

Internal classes

Nexus has roughly 29 classes tagged @internal — implementation details of the Behavior / ActorCell machinery that are not part of the public API surface. They are documented in the Internal classes appendix along with an explanation of why each one is hidden.