Actors Guide
Status
Actor integration in the framework is partial. The VM has an ActorSystem
with basic spawn/send/receive mechanics. The framework does not yet wire actors
into the App protocol runtime.
Architecture
Parent App
├── init() → State
├── update(state, msg) → UpdateResult
│ └── effects: [Effect { kind: "spawn_actor", ... }]
├── view(state) → UINode
└── Child Actor (same App protocol)
├── init() → State
├── update(state, msg) → UpdateResult
└── view(state) → UINode
Spawning Actors
Return a spawn_actor effect from update():
Effect { kind: "spawn_actor", payload: "child_module", callback_tag: "child_spawned" }
No child module is compiled or started. What happens depends on how the app is run:
AppRuntime::send(andboruna framework test) checks the effect against the policy (capabilityactor.spawn) and returns it as data. Nothing is executed.- With
MockEffectExecutor, the parent gets achild_spawnedmessage whose payload is a fakeActorId(1, 2, 3, …). No actor exists behind it. - With
HostEffectExecutor, the effect is passed to the capability gateway asactor.spawn. There is no actor runtime there; the default handler returnsUnit, which is delivered as thechild_spawnedpayload.
Message Routing
- Parent → Child:
send_to_actoris a recognised effect kind (capabilityactor.send), but nothing delivers it to an actor.MockEffectExecutoranswers with"delivered";HostEffectExecutorpasses it to the gateway, whose default handler returnsUnit. - Child → Parent: not implemented at the framework level.
Supervision
At the framework level there is no supervision: no child actors run, and no
actor_error message is ever produced.
The VM’s ActorSystem does supervise: when an actor fails, it is marked failed,
the failure cascades to all its descendants, and the parent receives an
Err(<error description>) message. If the root actor fails, the error is
returned from the run.
Scheduling
VM ActorSystem: round-robin scheduling, always deterministic. Pending messages
are delivered at the end of each round, sorted by (target ID, sender ID).
Current Limitations
- Actor spawning is not executed by the framework runtime (only parsed as effects).
- No inter-actor message routing at the framework level.
- No supervision at the framework level (the VM
ActorSystemhas it). - The VM’s
ActorSystemexists but is not integrated withAppRuntime.
VM-Level Actor API
The VM provides these opcodes for actors:
SpawnActor(func_idx)— spawn actor from functionSendMsg— send message to actor IDReceiveMsg— block for incoming message
These are available in bytecode but not yet connected to the framework’s effect-based actor model.