pub struct InnerState {Show 22 fields
pub data_dir: PathBuf,
pub db_path: PathBuf,
pub unsafe_mode: bool,
pub async_database: Arc<AsyncDatabase>,
pub logs_dir: PathBuf,
pub config_runtime: ArcSwap<ConfigRuntimeSnapshot>,
pub running: Mutex<HashMap<String, RunningTask>>,
pub agent_health: RwLock<HashMap<String, AgentHealthState>>,
pub agent_metrics: RwLock<HashMap<String, AgentMetrics>>,
pub agent_lifecycle: RwLock<HashMap<String, AgentRuntimeState>>,
pub message_bus: Arc<MessageBus>,
pub event_sink: RwLock<Arc<dyn EventSink>>,
pub db_writer: Arc<DbWriteCoordinator>,
pub session_store: Arc<AsyncSessionStore>,
pub task_repo: Arc<AsyncSqliteTaskRepository>,
pub store_manager: StoreManager,
pub daemon_runtime: DaemonRuntimeState,
pub worker_notify: Arc<Notify>,
pub trigger_event_tx: Sender<TriggerEventPayload>,
pub trigger_engine_handle: Mutex<Option<TriggerEngineHandle>>,
pub fs_watcher_reload_tx: Mutex<Option<Sender<()>>>,
pub task_enqueuer: Arc<dyn TaskEnqueuer>,
}Expand description
Shared daemon state referenced by services and scheduler code.
Fields§
§data_dir: PathBufRuntime data directory (~/.orchestratord by default).
db_path: PathBufSQLite database path.
unsafe_mode: boolWhether unsafe mode is enabled.
async_database: Arc<AsyncDatabase>Async database handle.
logs_dir: PathBufDirectory containing task and command logs.
config_runtime: ArcSwap<ConfigRuntimeSnapshot>Atomically swappable configuration snapshot.
running: Mutex<HashMap<String, RunningTask>>Currently running tasks keyed by task ID.
agent_health: RwLock<HashMap<String, AgentHealthState>>Runtime agent-health map.
agent_metrics: RwLock<HashMap<String, AgentMetrics>>Runtime agent metrics map.
agent_lifecycle: RwLock<HashMap<String, AgentRuntimeState>>Runtime agent lifecycle map.
message_bus: Arc<MessageBus>Collaboration message bus.
event_sink: RwLock<Arc<dyn EventSink>>Event sink used by synchronous and asynchronous execution paths.
db_writer: Arc<DbWriteCoordinator>Serialized database write coordinator.
session_store: Arc<AsyncSessionStore>Interactive session store.
task_repo: Arc<AsyncSqliteTaskRepository>Async task repository wrapper.
store_manager: StoreManagerWorkflow store manager.
daemon_runtime: DaemonRuntimeStateRuntime daemon lifecycle state.
worker_notify: Arc<Notify>In-process wakeup channel for idle workers.
trigger_event_tx: Sender<TriggerEventPayload>Broadcast channel for trigger-relevant task events (task_completed / task_failed).
trigger_engine_handle: Mutex<Option<TriggerEngineHandle>>Handle for notifying the trigger engine of config changes.
fs_watcher_reload_tx: Mutex<Option<Sender<()>>>Handle for notifying the filesystem watcher of config changes.
Set by the daemon; None in CLI-only contexts.
task_enqueuer: Arc<dyn TaskEnqueuer>Scheduler port for cross-crate task enqueue dispatch.
Wired with the real scheduler implementation by the daemon; defaults to
NoopTaskEnqueuer in tests
and CLI-only contexts.
Implementations§
Source§impl InnerState
impl InnerState
Sourcepub fn emit_event(
&self,
task_id: &str,
task_item_id: Option<&str>,
event_type: &str,
payload: Value,
)
pub fn emit_event( &self, task_id: &str, task_item_id: Option<&str>, event_type: &str, payload: Value, )
Emits an event through the currently configured event sink.
When the event is task_completed or task_failed, it is also broadcast
on trigger_event_tx so the trigger engine can evaluate event triggers.
Auto Trait Implementations§
impl !Freeze for InnerState
impl !RefUnwindSafe for InnerState
impl Send for InnerState
impl Sync for InnerState
impl Unpin for InnerState
impl UnsafeUnpin for InnerState
impl !UnwindSafe for InnerState
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request