pub struct SharedSystemState {
pub conversations: Arc<ConversationHierarchy>,
pub llm_runtime: Arc<RwLock<Option<LLMRuntime>>>,
pub cache_manager: Arc<RwLock<Option<Arc<KVCacheManager>>>>,
pub database_pool: Arc<MemoryDatabase>,
pub config: Arc<Config>,
pub counters: Arc<AtomicCounters>,
pub context_orchestrator: Arc<RwLock<Option<ContextOrchestrator>>>,
pub llm_worker: Arc<LLMWorker>,
}Expand description
Core shared system state container
Fields§
§conversations: Arc<ConversationHierarchy>Conversation data with hierarchical locking
llm_runtime: Arc<RwLock<Option<LLMRuntime>>>LLM runtime for direct inference
cache_manager: Arc<RwLock<Option<Arc<KVCacheManager>>>>Cache management system
database_pool: Arc<MemoryDatabase>Database connection pool
config: Arc<Config>Configuration (read-only after initialization)
counters: Arc<AtomicCounters>Atomic counters for performance tracking
context_orchestrator: Arc<RwLock<Option<ContextOrchestrator>>>Context orchestrator for memory management (tokio RwLock for async access)
llm_worker: Arc<LLMWorker>LLM worker for inference operations
Implementations§
pub fn new(config: Config, database: Arc<MemoryDatabase>) -> Result<Self>
Sourcepub fn set_llm_worker(&self, _worker: Arc<LLMWorker>)
pub fn set_llm_worker(&self, _worker: Arc<LLMWorker>)
Set LLM worker (replaces the default one created during initialization)
Sourcepub fn initialize_llm_runtime(&self) -> Result<()>
pub fn initialize_llm_runtime(&self) -> Result<()>
Initialize LLM runtime with current configuration
Sourcepub async fn get_or_create_session(
&self,
session_id: &str,
) -> Arc<RwLock<SessionData>>
pub async fn get_or_create_session( &self, session_id: &str, ) -> Arc<RwLock<SessionData>>
Get or create session data with proper locking
Sourcepub fn queue_message(&self, session_id: &str, message: Message) -> bool
pub fn queue_message(&self, session_id: &str, message: Message) -> bool
Queue message for asynchronous processing
Sourcepub async fn process_queued_messages(
&self,
session_id: &str,
) -> Vec<PendingMessage>
pub async fn process_queued_messages( &self, session_id: &str, ) -> Vec<PendingMessage>
Process queued messages for a session
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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