Skip to main content

Mountain/RunTime/ApplicationRunTime/
mod.rs

1#![allow(non_snake_case)]
2
3//! Echo-scheduler-powered runtime that executes `ActionEffect` pipelines.
4//! Method-per-file impls live as siblings under `RunTime/Execute/` and
5//! `RunTime/Shutdown/`. The struct stays here (no `pub use` indirection)
6//! so callers spell `RunTime::ApplicationRunTime::ApplicationRunTime`.
7
8use std::sync::Arc;
9
10use CommonLibrary::Environment::{Environment::Environment, HasEnvironment::HasEnvironment};
11use Echo::Scheduler::Scheduler::Scheduler;
12
13use crate::{Environment::MountainEnvironment::MountainEnvironment, dev_log};
14
15#[derive(Clone)]
16pub struct ApplicationRunTime {
17	/// Shared handle to the application's central scheduler.
18	pub Scheduler:Arc<Scheduler>,
19	/// Shared handle to the `MountainEnvironment` capability provider.
20	pub Environment:Arc<MountainEnvironment>,
21}
22
23impl ApplicationRunTime {
24	pub fn Create(Scheduler:Arc<Scheduler>, Environment:Arc<MountainEnvironment>) -> Self {
25		dev_log!("lifecycle", "new Echo-based instance created");
26		Self { Scheduler, Environment }
27	}
28}
29
30impl HasEnvironment for ApplicationRunTime {
31	type EnvironmentType = MountainEnvironment;
32
33	fn GetEnvironment(&self) -> Arc<Self::EnvironmentType> { self.Environment.clone() }
34}
35
36impl Environment for ApplicationRunTime {}