pub trait DaemonExecutor<H: HttpClient>:
Storage
+ Send
+ Sync {
// Required methods
fn http_client(&self) -> &Arc<H> ⓘ;
fn config(&self) -> &DaemonConfig;
fn run(
self: Arc<Self>,
shutdown_token: CancellationToken,
) -> Result<JoinHandle<Result<()>>>;
}Expand description
Daemon executor trait for runtime orchestration.
This trait handles only the daemon lifecycle - spawning the background worker that processes requests. All data operations are on the Storage trait.
Required Methods§
Sourcefn http_client(&self) -> &Arc<H> ⓘ
fn http_client(&self) -> &Arc<H> ⓘ
Get a reference to the HTTP client.
Sourcefn config(&self) -> &DaemonConfig
fn config(&self) -> &DaemonConfig
Get a reference to the daemon configuration.
Sourcefn run(
self: Arc<Self>,
shutdown_token: CancellationToken,
) -> Result<JoinHandle<Result<()>>>
fn run( self: Arc<Self>, shutdown_token: CancellationToken, ) -> Result<JoinHandle<Result<()>>>
Run the daemon thread.
This spawns a background task responsible for actually doing the work of moving requests from one state to another, and broadcasting those status changes.
The daemon will:
- Claim pending requests
- Execute HTTP requests
- Handle retries with exponential backoff
- Update request statuses
- Respect per-model concurrency limits
§Errors
Returns an error if the daemon fails to start.
§Example
ⓘ
let manager = Arc::new(manager);
let handle = manager.run()?;
// Do work...
// Shutdown gracefully (implementation-specific)
handle.abort();Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".