Actors#
Hyperactor programs are structured around actors: isolated state machines that process messages asynchronously.
Each actor runs in isolation, and maintains private internal state. Actors interact with the outside world through typed message ports and follow strict lifecycle semantics managed by the runtime.
This chapter introduces the actor system in hyperactor. We’ll cover:
The
Actor
trait and its lifecycle hooksThe
Handler
trait for defining message-handling behaviorThe
RemotableActor
trait for enabling remote spawningThe
Checkpointable
trait for supporting actor persistence and recoveryThe
RemoteActor
marker trait for remotely referencable typesThe
Binds
trait for wiring exported ports to reference typesThe
RemoteHandles
trait for associating message types with a referenceThe
ActorHandle
type for referencing and communicating with running actorsActor Lifecycle, including
Signal
andActorStatus
Actors are instantiated with parameters and bound to mailboxes, enabling reliable message-passing. The runtime builds upon this foundation to support supervision, checkpointing, and remote interaction via typed references.