Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/RunTime/ApplicationRunTime/
mod.rs

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