A Rust supervision framework inspired by Erlang/OTP, with Python bindings.
- Process supervision trees with automatic restart
- Configurable restart policies (Permanent, Temporary, Transient)
- Supervision strategies (OneForOne, OneForAll, RestForOne)
- Worker messaging via mailboxes
- Distributed supervision across network nodes
- Python bindings with asyncio integration
cargo add ash-flareInstall from GitHub Releases:
uv add "ash-flare @ https://github.com/ashforge-rs/ash-flare/releases/latest/download/ash_flare-2.0.0-cp39-abi3-linux_x86_64.whl"Replace the wheel filename with the appropriate version and platform from the releases page
use ash_flare::{Supervisor, RestartPolicy};
use std::time::Duration;
let handle = Supervisor::new("my_supervisor")
.with_restart_policy(RestartPolicy::Permanent)
.with_restart_delay(Duration::from_secs(5))
.spawn()
.await?;
handle.start_child_linked(
"worker",
|| MyWorker::new(),
RestartPolicy::Permanent,
Duration::from_secs(5),
).await?;from ash_flare import Supervisor
supervisor = Supervisor("my_supervisor")
supervisor.start_child("worker", MyWorker)For async Python usage with asyncio.to_thread():
import asyncio
async def send_message(handle, msg):
await asyncio.to_thread(handle.send, msg)Apache License 2.0 - see LICENSE
- Inspired by Erlang/OTP supervision principle
- Some code generated with the help of AI tools