pub enum WorldCommand {
Spawn {
parent: ChannelId,
config: ChannelConfig,
reply: Sender<Option<ChannelId>>,
},
SpawnWithId {
parent: ChannelId,
id: ChannelId,
config: ChannelConfig,
reply: Sender<bool>,
},
Kill {
id: ChannelId,
reason: String,
},
Complete {
id: ChannelId,
reply: Sender<bool>,
},
UpdateState {
id: ChannelId,
transition: StateTransition,
reply: Sender<bool>,
},
GetState {
id: ChannelId,
reply: Sender<Option<ChannelState>>,
},
Shutdown,
}Expand description
Commands for modifying World state.
These commands are sent to the WorldManager
which applies them sequentially to maintain consistency.
Variants§
Spawn
Spawn a new child channel.
Creates a new channel under the specified parent with the given config. The new channel’s ID is returned via the reply channel.
Fields
config: ChannelConfigConfiguration for the new channel.
SpawnWithId
Spawn a new child channel with a pre-determined ChannelId.
Same as Spawn but the caller supplies the ID.
Used by spawn_runner which needs the ID before the World is updated.
Fields
config: ChannelConfigConfiguration for the new channel.
Kill
Kill a channel and all its descendants.
Removes the channel from the World entirely.
Complete
Complete a channel successfully.
Transitions the channel to Completed state but keeps it in the World.
UpdateState
Update a channel’s state.
Used for state transitions like Pause, Resume, AwaitApproval.
Fields
transition: StateTransitionNew state to transition to.
GetState
Query a channel’s current state (read-only).
For read operations that need consistency with pending writes.
Fields
reply: Sender<Option<ChannelState>>Reply with the current state, or None if not found.
Shutdown
Shutdown the WorldManager.
Signals the manager to stop processing commands.