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

Method receive

crates/opencode-mcp/src/client.rs:948–957  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

946 }
947
948 async fn receive(&self) -> Result<Option<JsonRpcMessage>, McpClientError> {
949 let next = self.messages.lock().await.pop_front();
950 match next {
951 Some((delay, message)) => {
952 sleep(delay).await;
953 Ok(message)
954 }
955 None => Ok(None),
956 }
957 }
958
959 async fn close(&self) -> Result<(), McpClientError> {
960 Ok(())

Callers 2

send_requestMethod · 0.45

Calls 1

sleepFunction · 0.85

Tested by

no test coverage detected