Skip to main content

Mountain/RunTime/ApplicationRunTime/
mod.rs

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