Expand description
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
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,
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);
}Structs§
- Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Date
Time - ISO 8601 combined date and time with time zone.
- Duration
- A
Durationtype to represent a span of time, typically used for system timeouts. - Execution
Config - Configuration for ExecutionEngine
- Execution
Engine - Main execution engine
- Execution
Metadata - Metadata for tracking executions
- Execution
Plan - Plan for executing multiple commands
- Execution
Request - Single command execution request
- Execution
Result - Result of a single command execution
- Execution
State - Internal state tracking
- Execution
Stats - Statistics for plan execution
- Execution
Summary - Summary information for listing executions
- HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- Logging
Event Handler - Logging event handler (logs to stderr)
- Multi
Event Handler - Multi-handler that broadcasts to multiple handlers
- Noop
Event Handler - No-op event handler (does nothing)
- PathBuf
- An owned, mutable path (akin to
String). - Plan
Execution Result - Result of executing a plan
- RwLock
- An asynchronous reader-writer lock.
- Utc
- The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
- Uuid
- A Universally Unique Identifier (UUID).
Enums§
- Command
- Standardized command types
- Execution
Error - Main error type for execution operations
- Execution
Event - Events emitted during execution
- Execution
Status - Status enum for executions
- Execution
Strategy - Strategy for executing multiple commands
- Oversized
Output Strategy - Strategy for handling output that exceeds max_output_size_bytes
- Validation
Error - Validation-specific errors
Traits§
- Event
Handler - Event handler trait
Type Aliases§
- Execution
Handle - Type alias for a single execution handle
- Execution
Map - Type alias for the execution map (shared state across threads)
- Result
- Result type alias for execution operations
- Validation
Result - Result type alias for validation operations