update api, fix tests and examples
This commit is contained in:
		
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							@@ -20,9 +20,11 @@ hero-supervisor/
 | 
			
		||||
 | 
			
		||||
The crate uses Rust's feature system to provide conditional compilation:
 | 
			
		||||
 | 
			
		||||
- **`default`**: Includes all functionality - supervisor, OpenRPC server, and CLI binary
 | 
			
		||||
- **`default`**: Includes CLI functionality
 | 
			
		||||
- **`cli`**: Enables the supervisor binary (included in default)
 | 
			
		||||
 | 
			
		||||
All OpenRPC functionality is now included by default for simplified deployment.
 | 
			
		||||
 | 
			
		||||
## Architecture
 | 
			
		||||
 | 
			
		||||
The Hero Supervisor uses a clean, simplified architecture with centralized resource management:
 | 
			
		||||
@@ -60,6 +62,9 @@ Simplified runner configuration and management. Contains `Runner` struct with co
 | 
			
		||||
#### `src/job.rs`
 | 
			
		||||
Job data structures, builder pattern, and Redis key management. Defines `Job` struct with metadata, script content, and status tracking.
 | 
			
		||||
 | 
			
		||||
#### `src/client.rs`
 | 
			
		||||
Client implementation for job management operations. Provides Redis-based job storage, retrieval, status updates, and lifecycle management. Separates job operations from supervisor logic.
 | 
			
		||||
 | 
			
		||||
#### `src/openrpc.rs`
 | 
			
		||||
OpenRPC server implementation that exposes all supervisor functionality over JSON-RPC. Implements RPC trait directly on the supervisor for clean integration.
 | 
			
		||||
 | 
			
		||||
@@ -148,14 +153,14 @@ curl -X POST -H "Content-Type: application/json" \
 | 
			
		||||
 | 
			
		||||
### Building
 | 
			
		||||
```bash
 | 
			
		||||
# Library only
 | 
			
		||||
# Build everything (default includes CLI and OpenRPC)
 | 
			
		||||
cargo build
 | 
			
		||||
 | 
			
		||||
# Library only (minimal build)
 | 
			
		||||
cargo build --no-default-features
 | 
			
		||||
 | 
			
		||||
# With CLI
 | 
			
		||||
# With CLI (same as default)
 | 
			
		||||
cargo build --features cli
 | 
			
		||||
 | 
			
		||||
# With OpenRPC server
 | 
			
		||||
cargo build --features openrpc
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Testing
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user