1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Effect event system for tracking and monitoring.
use crate::effects::Effect;
use std::thread::ThreadId;
use std::time::SystemTime;
/// An event in the effect system.
#[derive(Debug, Clone)]
pub struct EffectEvent {
/// Thread that produced this event
pub thread_id: ThreadId,
/// Timestamp of the event
pub timestamp: SystemTime,
/// Type of effect event
pub event_type: EffectEventType,
/// Associated effect
pub effect: Effect,
/// Optional additional context
pub context: Option<String>,
/// Sequence number for ordering
pub sequence: u64,
/// Dependencies on other effects
pub dependencies: Vec<u64>,
}
/// Types of effect events.
#[derive(Debug, Clone)]
pub enum EffectEventType {
/// Effect was activated
Activated,
/// Effect was deactivated
Deactivated,
/// Effect produced a result
Produced,
/// Effect was handled
Handled,
/// Effect caused an error
Error(String),
/// Effect is waiting for coordination
WaitingForCoordination,
/// Effect coordination completed
CoordinationCompleted,
/// Effect was rolled back due to transaction failure
RolledBack,
}