MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / get_module_host

Method get_module_host

crates/core/src/host/host_controller.rs:559–569  ·  view source on GitHub ↗
(&self, replica_id: u64)

Source from the content-addressed store, hash-verified

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.

Callers 2

moduleMethod · 0.80
wait_for_moduleMethod · 0.80

Calls 5

acquire_read_lockMethod · 0.80
mapMethod · 0.45
as_refMethod · 0.45
cloneMethod · 0.45
borrowMethod · 0.45

Tested by

no test coverage detected