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
20 /// Shared handle to the `MountainEnvironment` capability provider.
21 pub Environment:Arc<MountainEnvironment>,
22}
23
24impl ApplicationRunTime {
25 pub fn Create(Scheduler:Arc<Scheduler>, Environment:Arc<MountainEnvironment>) -> Self {
26 dev_log!("lifecycle", "new Echo-based instance created");
27
28 Self { Scheduler, Environment }
29 }
30}
31
32impl HasEnvironment for ApplicationRunTime {
33 type EnvironmentType = MountainEnvironment;
34
35 fn GetEnvironment(&self) -> Arc<Self::EnvironmentType> { self.Environment.clone() }
36}
37
38impl Environment for ApplicationRunTime {}