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§
- Actor
Failure - A failed turn: an error returned by the actor or a caught panic.
- Actor
Input - One input to an actor’s turn.
- Actor
Start - How an actor kind is started by
<invoke>. - Chart
Actor - 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.
- Stream
Actor - 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. - Turn
Output - What a turn produced.
Enums§
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
namewithdata.
Type Aliases§
- Actor
Factory - Creates an actor of one kind for an
<invoke>. - ActorFn
- The function behind a
FnActor: one input in, a turn’s output out. - Actor
Stream - The stream behind a
StreamActor.