Files
supervisor/examples
Timur Gordon 9b3477d6d2 feat: align OpenRPC server with simplified client API
- Updated RegisterRunnerParams to only require name (queue = name)
- Added AddRunnerParams with RunnerConfig for add_runner method
- Updated RunnerManagementParams and StopRunnerParams with secrets
- Added add_runner method to OpenRPC trait and implementation
- Removed duplicate AddRunnerParams definition
- Updated client register_runner to send params as JSON object
- Added TODO comments for moving secrets to HTTP headers
2025-10-27 14:48:46 +01:00
..

Hero Supervisor Examples

This directory contains examples demonstrating Hero Supervisor functionality.

Available Examples

osiris_openrpc

Comprehensive example showing the complete workflow of using Hero Supervisor with OSIRIS runners via OpenRPC.

Features:

  • Automatic supervisor and runner startup
  • OpenRPC client communication
  • Runner registration and management
  • Job dispatching with multiple scripts
  • Context-based access control
  • Graceful shutdown

Run:

cargo run --example osiris_openrpc

See osiris_openrpc/README.md for details.

Prerequisites

All examples require:

  • Redis server running on localhost:6379
  • Rust toolchain installed

Example Structure

examples/
├── README.md                    # This file
├── osiris_openrpc/             # OSIRIS + OpenRPC example
│   ├── main.rs                 # Main example code
│   ├── README.md               # Detailed documentation
│   ├── note.rhai               # Note creation script
│   ├── event.rhai              # Event creation script
│   ├── query.rhai              # Query script
│   └── access_denied.rhai      # Access control test script
└── _archive/                    # Archived old examples

Architecture Overview

The examples demonstrate the Hero Supervisor architecture:

Client (OpenRPC)
    ↓
Supervisor (OpenRPC Server)
    ↓
Redis Queue
    ↓
Runners (OSIRIS, SAL, etc.)

Development

To add a new example:

  1. Create a new directory under examples/
  2. Add main.rs with your example code
  3. Add any required script files (.rhai)
  4. Add a README.md documenting the example
  5. Update Cargo.toml to register the example
  6. Update this README with a link

Archived Examples

Previous examples have been moved to _archive/ for reference. These may be outdated but can provide useful patterns for specific use cases.