Skip to main content

Crate behavior

Crate behavior 

Source
Expand description

Pure actor algebra. A Behavior folds its associated event protocol into exactly Actions: sends, creates, and become. Timing, observation, supervision, stashing, and finite-state behavior are derived compositions.

Macros§

workers
workers![(4, WorkerA, build_a), (2, WorkerB, build_b)] → a block declaring the Crew sum and yielding (total, crew_build) for Supervising’s fleet. Slots are contiguous per variant (slot = nonce; rest-for-one’s birth order is the declaration order).

Structs§

Actions
Exactly Agha’s effect triple.
At
AtGeneration
AtId
Base
Births
This behavior may emit births of C.
ChildStopped
Create
Fresh actor creation. Replacement at an existing address is deliberately absent; stable restart is derived with a proxy actor.
Delivery
One statically typed send operation.
FnState
Fsm
MailAddr
NoBirths
This behavior cannot emit child births.
ObserveChild
ObservePeer
PeerStopped
Proxy
The stable actor. Every replacement is an ordinary fresh birth beneath it.
Recipient
A recipient statically coupled to the message it accepts.
ScheduleAt
SendProduct
A product of independently typed send protocols.
Spec
Stashing
Supervising
TimeReached
Transcript
User
The user-message event at the Agha floor.
Watching

Enums§

AtEvent
Crash
How the fold crashed. The reason VALUE stays with the driver in both cases (heterogeneous error types and panic payloads are runtime plumbing — typed reasons are the homogeneous-fleet door, deferred); the fold receives the DOMAIN. Both variants classify as abnormal; the distinction is preserved for future policy (e.g. poison-message handling) and for trace truth — the death site knows which one happened, and the report must not collapse it.
Exit
How a fold ends. The R parameter of the become verdict (Step<Ph, Exit>): a Stop carries one of these; the driver also mints Collected when the mailbox drains with no self-stop.
Move
Never
The uninhabited type with two structural jobs. As a phase menu, Step<Never> has no constructible Goto — a plain actor is a one-phase machine. As an outbound/offspring menu, it proves a layer sends or creates nothing. The law is the type, not a convention.
ProxyCommand
RestartPolicy
Route
An address expression. Services are actors supplied by the interpreter; their concrete addresses never enter the behavior or Spec API.
StashRoute
Step
The become verdict (Agha 1986): what replaces the current behavior as it processes one event.
Strategy
SupervisionEvent
WatchEvent

Traits§

Address
A pure actor-address namespace.
Behavior
A composed pure behavior. Event is the complete accepted protocol; successful transitions always return the same Agha effect algebra.
BirthMode
A type-level description of the creation leg of the actor algebra.
ChildEvent
PeerEvent
SendAlgebra
The monoid required to accumulate sends across transitions.
State
TimeEvent
UserEvent
Construction/extraction of the user lane through a composed event type.

Functions§

restart_all
restart_one
restart_rest
run
Drive user-lane messages through a complete behavior protocol.
stop_on_abnormal_death
Stop when the monitor reports an abnormal outcome.

Type Aliases§

Acted
AtReaction
Become
LinkReaction