pub struct OperationTimeoutConfig {
pub default_ms: u64,
pub capture_ms: u64,
pub recall_ms: u64,
pub sync_ms: u64,
pub embed_ms: u64,
pub redis_ms: u64,
pub sqlite_ms: u64,
pub postgres_ms: u64,
pub entity_extraction_ms: u64,
}Expand description
Operation-level timeout configuration (CHAOS-HIGH-005).
Provides configurable timeouts for different operation types to prevent indefinite blocking and ensure predictable latency behavior.
§Environment Variables
| Variable | Description | Default |
|---|---|---|
SUBCOG_TIMEOUT_DEFAULT_MS | Default timeout for all operations | 30000 |
SUBCOG_TIMEOUT_CAPTURE_MS | Capture operation timeout | 30000 |
SUBCOG_TIMEOUT_RECALL_MS | Recall/search operation timeout | 30000 |
SUBCOG_TIMEOUT_SYNC_MS | Git sync operation timeout | 60000 |
SUBCOG_TIMEOUT_EMBED_MS | Embedding generation timeout | 30000 |
SUBCOG_TIMEOUT_REDIS_MS | Redis operation timeout | 5000 |
SUBCOG_TIMEOUT_SQLITE_MS | SQLite operation timeout | 5000 |
SUBCOG_TIMEOUT_POSTGRES_MS | PostgreSQL operation timeout | 10000 |
Fields§
§default_ms: u64Default timeout in milliseconds for all operations.
capture_ms: u64Timeout for capture operations in milliseconds.
recall_ms: u64Timeout for recall/search operations in milliseconds.
sync_ms: u64Timeout for sync operations in milliseconds.
embed_ms: u64Timeout for embedding operations in milliseconds.
redis_ms: u64Timeout for Redis operations in milliseconds.
sqlite_ms: u64Timeout for SQLite operations in milliseconds.
postgres_ms: u64Timeout for PostgreSQL operations in milliseconds.
entity_extraction_ms: u64Timeout for entity extraction LLM operations in milliseconds. Default is 120 seconds (longer than general LLM timeout for complex content).
Implementations§
Source§impl OperationTimeoutConfig
impl OperationTimeoutConfig
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Applies environment variable overrides.
Sourcepub const fn get(&self, operation: OperationType) -> Duration
pub const fn get(&self, operation: OperationType) -> Duration
Gets the timeout for a specific operation type.
Sourcepub const fn with_default_ms(self, ms: u64) -> Self
pub const fn with_default_ms(self, ms: u64) -> Self
Builder method to set default timeout.
Sourcepub const fn with_capture_ms(self, ms: u64) -> Self
pub const fn with_capture_ms(self, ms: u64) -> Self
Builder method to set capture timeout.
Sourcepub const fn with_recall_ms(self, ms: u64) -> Self
pub const fn with_recall_ms(self, ms: u64) -> Self
Builder method to set recall timeout.
Sourcepub const fn with_sync_ms(self, ms: u64) -> Self
pub const fn with_sync_ms(self, ms: u64) -> Self
Builder method to set sync timeout.
Sourcepub const fn with_embed_ms(self, ms: u64) -> Self
pub const fn with_embed_ms(self, ms: u64) -> Self
Builder method to set embed timeout.
Sourcepub const fn with_redis_ms(self, ms: u64) -> Self
pub const fn with_redis_ms(self, ms: u64) -> Self
Builder method to set Redis timeout.
Sourcepub const fn with_sqlite_ms(self, ms: u64) -> Self
pub const fn with_sqlite_ms(self, ms: u64) -> Self
Builder method to set SQLite timeout.
Sourcepub const fn with_postgres_ms(self, ms: u64) -> Self
pub const fn with_postgres_ms(self, ms: u64) -> Self
Builder method to set PostgreSQL timeout.
Sourcepub const fn with_entity_extraction_ms(self, ms: u64) -> Self
pub const fn with_entity_extraction_ms(self, ms: u64) -> Self
Builder method to set entity extraction timeout.
Trait Implementations§
Source§impl Clone for OperationTimeoutConfig
impl Clone for OperationTimeoutConfig
Source§fn clone(&self) -> OperationTimeoutConfig
fn clone(&self) -> OperationTimeoutConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperationTimeoutConfig
impl Debug for OperationTimeoutConfig
Auto Trait Implementations§
impl Freeze for OperationTimeoutConfig
impl RefUnwindSafe for OperationTimeoutConfig
impl Send for OperationTimeoutConfig
impl Sync for OperationTimeoutConfig
impl Unpin for OperationTimeoutConfig
impl UnwindSafe for OperationTimeoutConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].