(&self, replica_id: u64)
| 557 | /// the host if it is not running. |
| 558 | #[tracing::instrument(level = "trace", skip_all)] |
| 559 | pub async fn get_module_host(&self, replica_id: u64) -> Result<ModuleHost, NoSuchModule> { |
| 560 | trace!("get module host {replica_id}"); |
| 561 | let guard = self.acquire_read_lock(replica_id).await.map_err(|_| { |
| 562 | warn!("timeout waiting for read lock on replica {replica_id} in `get_module_host`"); |
| 563 | NoSuchModule |
| 564 | })?; |
| 565 | guard |
| 566 | .as_ref() |
| 567 | .map(|Host { module, .. }| module.borrow().clone()) |
| 568 | .ok_or(NoSuchModule) |
| 569 | } |
| 570 | |
| 571 | /// Subscribe to updates of the [`ModuleHost`] identified by `replica_id`, |
| 572 | /// or return an error if it is not registered with the controller. |
no test coverage detected