pub enum ActorSystemCmd {
Register {
actor_type: String,
address: String,
mailbox: Arc<dyn Mailbox>,
restart_tx: Sender<()>,
kill_tx: Sender<()>,
life_cycle: LifeCycle,
result_tx: Sender<Result<(), ActorError>>,
is_restarted: bool,
},
Restart {
address_regex: String,
},
Unregister {
address_regex: String,
},
FilterAddress {
address_regex: String,
result_tx: Sender<Vec<String>>,
},
FindActor {
actor_type: String,
address: String,
result_tx: Sender<Option<(Arc<dyn Mailbox>, bool)>>,
},
SetLifeCycle {
address: String,
life_cycle: LifeCycle,
},
RegisterJob {
job_id: String,
controller: JobController,
},
FindJob {
job_id: String,
result_tx: Sender<Option<JobController>>,
},
}Expand description
Wire protocol between ActorSystem and the single actor_system_loop
task that owns the registry. Most users never construct these directly
— the public ActorSystem methods (send, register, restart,
run_job, etc.) wrap each variant.
Exposed (and reachable via ActorSystem::handler_tx) so advanced
callers can drive the loop manually — e.g. to issue several
FindActor lookups without going through the cache.
Variants§
Register
Insert a fresh actor into the registry. is_restarted = true
permits replacing an existing entry (used by the restart cycle);
false rejects duplicates with AddressAlreadyExist.
Fields
result_tx: Sender<Result<(), ActorError>>Restart
Trigger the restart cycle for every actor whose name matches the
regex. Backs ActorSystem::restart.
Unregister
Tear down every actor whose name matches the regex. Backs
ActorSystem::unregister.
FilterAddress
Snapshot of address names matching the regex. Backs
filter_address and the local side of send_broadcast.
FindActor
Look up a specific actor by (actor_type, address). Returns the
mailbox plus a ready flag (false while the actor is in
Starting/Restarting). Backs the send-family methods’
post-cache lookups.
SetLifeCycle
Update an actor’s LifeCycle. Pushed by the actor’s own
run_actor loop at each transition.
RegisterJob
Register a job’s JobController under job_id. Pushed by
run_job after spawning the job loop, so abort_job / stop_job
/ resume_job can later look it up.
FindJob
Look up a JobController by id. Backs abort_job / stop_job /
resume_job.