MCPcopy Create free account
hub / github.com/AI45Lab/Code / touch

Method touch

core/src/mcp/manager.rs:189–194  ·  view source on GitHub ↗

Mark a server as active right now. The framework calls this automatically on connect and on every successful [`call_tool`](Self::call_tool); hosts can call it explicitly to keep a server "warm" out of band (e.g. when a tool result comes back via a different channel).

(&self, name: &str)

Source from the content-addressed store, hash-verified

187 /// to keep a server "warm" out of band (e.g. when a tool result
188 /// comes back via a different channel).
189 pub async fn touch(&self, name: &str) {
190 self.last_used_at_ms
191 .write()
192 .await
193 .insert(name.to_string(), now_epoch_ms());
194 }
195
196 /// Disconnect every connected server whose last-used timestamp is
197 /// older than `now - idle_threshold_ms`. Returns the names of

Calls 3

writeMethod · 0.80
now_epoch_msFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected