MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / with_timeout

Function with_timeout

crates/opencode-util/src/util.rs:38–43  ·  view source on GitHub ↗
(duration: Duration, future: F)

Source from the content-addressed store, hash-verified

36 use tokio::time::timeout;
37
38 pub async fn with_timeout<T, F>(duration: Duration, future: F) -> Option<T>
39 where
40 F: std::future::Future<Output = T>,
41 {
42 timeout(duration, future).await.ok()
43 }
44}
45
46pub mod defer {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected