Initialize runtime with custom configuration
(config: RuntimeConfig)
| 149 | |
| 150 | /// Initialize runtime with custom configuration |
| 151 | pub(crate) fn init_runtime_with_config(config: RuntimeConfig) -> Result<(), std::io::Error> { |
| 152 | if GRAPHBIT_RUNTIME.get().is_some() { |
| 153 | warn!("Runtime already initialized, ignoring new configuration"); |
| 154 | return Ok(()); |
| 155 | } |
| 156 | |
| 157 | let runtime = GraphBitRuntime::new(config)?; |
| 158 | GRAPHBIT_RUNTIME.set(runtime).map_err(|_| { |
| 159 | std::io::Error::new( |
| 160 | std::io::ErrorKind::AlreadyExists, |
| 161 | "Runtime already initialized", |
| 162 | ) |
| 163 | })?; |
| 164 | |
| 165 | Ok(()) |
| 166 | } |
| 167 | |
| 168 | /// Get runtime statistics for monitoring |
| 169 | pub(crate) fn get_runtime_stats() -> Option<RuntimeStats> { |
no test coverage detected