pub struct DaemonConfig {Show 18 fields
pub claim_batch_size: usize,
pub default_model_concurrency: usize,
pub model_concurrency_limits: Arc<DashMap<String, usize>>,
pub claim_interval_ms: u64,
pub max_retries: Option<u32>,
pub stop_before_deadline_ms: Option<i64>,
pub backoff_ms: u64,
pub backoff_factor: u64,
pub max_backoff_ms: u64,
pub timeout_ms: u64,
pub status_log_interval_ms: Option<u64>,
pub heartbeat_interval_ms: u64,
pub should_retry: ShouldRetryFn,
pub claim_timeout_ms: u64,
pub processing_timeout_ms: u64,
pub cancellation_poll_interval_ms: u64,
pub sla_check_interval_seconds: u64,
pub sla_thresholds: Vec<SlaThreshold>,
}Expand description
Configuration for the daemon.
Fields§
§claim_batch_size: usizeMaximum number of requests to claim in each iteration
default_model_concurrency: usizeDefault concurrency limit per model
model_concurrency_limits: Arc<DashMap<String, usize>>Per-model concurrency overrides (shared, can be updated dynamically)
claim_interval_ms: u64How long to sleep between claim iterations
max_retries: Option<u32>Maximum number of retry attempts before giving up.
stop_before_deadline_ms: Option<i64>Stop retrying this many milliseconds before the batch expires. Positive values stop before the deadline (safety buffer). Negative values allow retrying after the deadline. If None, retries are not deadline-aware.
backoff_ms: u64Base backoff duration in milliseconds (will be exponentially increased)
backoff_factor: u64Factor by which the backoff_ms is increased with each retry
max_backoff_ms: u64Maximum backoff time in milliseconds
timeout_ms: u64Timeout for each individual request attempt in milliseconds
status_log_interval_ms: Option<u64>Interval for logging daemon status (requests in flight) in milliseconds Set to None to disable periodic status logging
heartbeat_interval_ms: u64Interval for sending heartbeats to update daemon status in database (milliseconds)
should_retry: ShouldRetryFnPredicate function to determine if a response should be retried. Defaults to retrying 5xx, 429, and 408 status codes.
claim_timeout_ms: u64Maximum time a request can stay in “claimed” state before being unclaimed and returned to pending (milliseconds). This handles daemon crashes.
processing_timeout_ms: u64Maximum time a request can stay in “processing” state before being unclaimed and returned to pending (milliseconds). This handles daemon crashes during execution.
cancellation_poll_interval_ms: u64Interval for polling database to check for cancelled batches (milliseconds) Determines how quickly in-flight requests are aborted when their batch is cancelled
sla_check_interval_seconds: u64How often to check for batches approaching SLA deadlines (seconds) Default: 60 (1 minute) Only used if sla_thresholds is non-empty
sla_thresholds: Vec<SlaThreshold>SLA threshold configurations. Each threshold defines a time limit and action to take when batches approach expiration. The daemon will query the database once per threshold to find at-risk batches.
Example: Two thresholds (warning at 1 hour, critical at 15 minutes)
use fusillade::daemon::{SlaThreshold, SlaAction, SlaLogLevel};
vec![
SlaThreshold {
name: "warning".to_string(),
threshold_seconds: 3600,
action: SlaAction::Log { level: SlaLogLevel::Warn },
},
SlaThreshold {
name: "critical".to_string(),
threshold_seconds: 900,
action: SlaAction::Log { level: SlaLogLevel::Error },
},
]Trait Implementations§
Source§impl Clone for DaemonConfig
impl Clone for DaemonConfig
Source§fn clone(&self) -> DaemonConfig
fn clone(&self) -> DaemonConfig
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for DaemonConfig
impl Default for DaemonConfig
Source§impl<'de> Deserialize<'de> for DaemonConfig
impl<'de> Deserialize<'de> for DaemonConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&DaemonConfig> for RetryConfig
impl From<&DaemonConfig> for RetryConfig
Source§fn from(config: &DaemonConfig) -> Self
fn from(config: &DaemonConfig) -> Self
Auto Trait Implementations§
impl Freeze for DaemonConfig
impl !RefUnwindSafe for DaemonConfig
impl Send for DaemonConfig
impl Sync for DaemonConfig
impl Unpin for DaemonConfig
impl !UnwindSafe for DaemonConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more