Skip to main content

Module actor

Module actor 

Source
Expand description

The actor contract and its adapters for charts, async functions and streams.

An actor receives SCXML events one at a time and produces zero or more outgoing events. A running chart is one implementation (ChartActor); an async function (FnActor) and a stream source (StreamActor) are others, so all of them are interchangeable as targets of <send> and <invoke>. A turn is either finished at once (Turn::Ready, a chart’s macrostep) or a Send future the runtime runs in the background (Turn::Pending); in both cases the actor takes no other input until the turn is over.

Structs§

ActorFailure
A failed turn: an error returned by the actor or a caught panic.
ActorInput
One input to an actor’s turn.
ActorStart
How an actor kind is started by <invoke>.
ChartActor
A chart run as an actor without a journal: an invoked chart child, whose inputs are journaled by its parent.
FnActor
An actor that runs an async function per input.
Outgoing
One outgoing event.
StreamActor
An actor that forwards the items of a stream to its parent as events named item_event, one per turn, and completes when the stream ends.
TurnOutput
What a turn produced.

Enums§

OutTarget
Where an outgoing event goes.
Turn
The result of starting a turn.

Constants§

START_EVENT
The event name of the input that starts an actor.
STREAM_NEXT_EVENT
The event a stream actor sends itself to pull its next item.

Traits§

Actor
The actor contract: one event in, zero or more events out, one turn at a time.

Functions§

platform_event
A platform event named name with data.

Type Aliases§

ActorFactory
Creates an actor of one kind for an <invoke>.
ActorFn
The function behind a FnActor: one input in, a turn’s output out.
ActorStream
The stream behind a StreamActor.