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

Method timeout

crates/runtime/src/lib.rs:312–325  ·  view source on GitHub ↗
(
        &self,
        timeout_after: Duration,
        future: impl Future<Output = T>,
    )

Source from the content-addressed store, hash-verified

310 }
311
312 pub async fn timeout<T>(
313 &self,
314 timeout_after: Duration,
315 future: impl Future<Output = T>,
316 ) -> Result<T, RuntimeTimeout> {
317 match self {
318 #[cfg(feature = "tokio")]
319 Self::Tokio(_) => tokio::time::timeout(timeout_after, future)
320 .await
321 .map_err(|_| RuntimeTimeout),
322 #[cfg(feature = "simulation")]
323 Self::Simulation(handle) => handle.timeout(timeout_after, future).await.map_err(|_| RuntimeTimeout),
324 }
325 }
326
327 pub async fn sleep(&self, duration: Duration) {
328 match self {

Callers 8

newMethod · 0.45
newMethod · 0.45
spawn_closeFunction · 0.45
server_logoutFunction · 0.45
latest_version_or_cachedFunction · 0.45

Calls

no outgoing calls