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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Cloudops Execution Engine
//!
//! Production-ready async execution engine for system commands.
//!
//! ## Features
//!
//! - Async/non-blocking execution
//! - Real-time output streaming
//! - Semaphore-based concurrency control
//! - Automatic memory cleanup
//! - Resource limits (timeout, output size, concurrency)
//! - Event-driven updates
//!
//! ## Example
//!
//! ```rust,no_run
//! use execution_engine::*;
//! use std::sync::Arc;
//!
//! #[tokio::main]
//! async fn main() {
//! let config = ExecutionConfig::default();
//! let engine = Arc::new(ExecutionEngine::new(config).unwrap());
//!
//! let request = ExecutionRequest {
//! id: Uuid::new_v4(),
//! command: Command::Shell {
//! command: "echo 'Hello'".to_string(),
//! shell: "/bin/bash".to_string(),
//! },
//! timeout_ms: Some(5000),
//! env: HashMap::new(),
//! working_dir: None,
//! output_log_path: None,
//! metadata: ExecutionMetadata::default(),
//! };
//!
//! let execution_id = engine.execute(request).await.unwrap();
//!
//! let result = engine.wait_for_completion(execution_id).await.unwrap();
//!
//! println!("Output: {}", result.stdout);
//! }
//! ```
// Module declarations
// Public exports
pub use *;
pub use ExecutionEngine;
pub use *;
pub use *;
pub use *;
// Re-exports for convenience
pub use ;
pub use HashMap;
pub use PathBuf;
pub use Arc;
pub use Duration;
pub use RwLock;
pub use Uuid;
// Type aliases for complex types
/// Type alias for the execution map (shared state across threads)
pub type ExecutionMap = ;
/// Type alias for a single execution handle
pub type ExecutionHandle = ;
/// Type alias for the cancellation token map
pub type CancellationTokenMap = ;