saluki_core/topology/
context.rs1use resource_accounting::MemoryLimiter;
2use tokio::runtime::Handle;
3
4use crate::health::HealthRegistry;
5use crate::runtime::state::DataspaceRegistry;
6
7#[derive(Clone)]
9pub struct TopologyContext {
10 memory_limiter: MemoryLimiter,
11 health_registry: HealthRegistry,
12 global_thread_pool: Handle,
13 dataspace: DataspaceRegistry,
14}
15
16impl TopologyContext {
17 pub fn new(
19 memory_limiter: MemoryLimiter, health_registry: HealthRegistry, global_thread_pool: Handle,
20 dataspace: DataspaceRegistry,
21 ) -> Self {
22 Self {
23 memory_limiter,
24 health_registry,
25 global_thread_pool,
26 dataspace,
27 }
28 }
29
30 pub fn memory_limiter(&self) -> &MemoryLimiter {
32 &self.memory_limiter
33 }
34
35 pub fn health_registry(&self) -> &HealthRegistry {
37 &self.health_registry
38 }
39
40 pub fn global_thread_pool(&self) -> &Handle {
42 &self.global_thread_pool
43 }
44
45 pub fn dataspace(&self) -> &DataspaceRegistry {
47 &self.dataspace
48 }
49}