palladium_runtime/
common.rs1use crate::reactor::Reactor;
2use palladium_actor::{
3 ActorError, ActorPath, AddrHash, ChildSpec, Envelope, MessagePayload, StopReason,
4};
5use std::time::Duration;
6
7pub(crate) enum ActorCmd<R: Reactor> {
10 Spawn {
12 spec: ChildSpec<R>,
13 parent: ActorPath,
14 },
15 Stop,
17 SendAfter {
19 delay: Duration,
20 envelope: Envelope,
21 payload: MessagePayload,
22 },
23}
24
25pub(crate) enum ChildEvent<R: Reactor> {
27 #[allow(dead_code)]
29 Started,
30 StartFailed {
32 addr: AddrHash,
33 #[allow(dead_code)]
34 error: ActorError,
35 },
36 MessageFailed {
38 addr: AddrHash,
39 #[allow(dead_code)]
40 error: ActorError,
41 },
42 Stopped {
44 addr: AddrHash,
45 #[allow(dead_code)]
46 reason: StopReason,
47 },
48 SpawnRequest {
50 spec: ChildSpec<R>,
51 parent: ActorPath,
52 },
53}
54
55#[derive(Debug, Clone)]
57pub enum LifecycleSignal<R: Reactor> {
58 Stop(StopReason),
59 SpawnChild(ChildSpec<R>),
60}