saluki_core/topology/
context.rs1use std::sync::Arc;
2
3use tokio::runtime::Handle;
4
5use crate::accounting::MemoryLimiter;
6use crate::health::HealthRegistry;
7use crate::runtime::state::DataspaceRegistry;
8
9#[derive(Clone)]
11pub struct TopologyContext {
12 topology_name: Arc<str>,
13 memory_limiter: MemoryLimiter,
14 health_registry: HealthRegistry,
15 global_thread_pool: Handle,
16 dataspace: DataspaceRegistry,
17}
18
19impl TopologyContext {
20 pub fn new(
22 topology_name: Arc<str>, memory_limiter: MemoryLimiter, health_registry: HealthRegistry,
23 global_thread_pool: Handle, dataspace: DataspaceRegistry,
24 ) -> Self {
25 Self {
26 topology_name,
27 memory_limiter,
28 health_registry,
29 global_thread_pool,
30 dataspace,
31 }
32 }
33
34 pub fn topology_name(&self) -> &str {
36 &self.topology_name
37 }
38
39 pub fn memory_limiter(&self) -> &MemoryLimiter {
41 &self.memory_limiter
42 }
43
44 pub fn health_registry(&self) -> &HealthRegistry {
46 &self.health_registry
47 }
48
49 pub fn global_thread_pool(&self) -> &Handle {
51 &self.global_thread_pool
52 }
53
54 pub fn dataspace(&self) -> &DataspaceRegistry {
56 &self.dataspace
57 }
58}