MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / send_cache_event

Method send_cache_event

crates/cache/src/worker.rs:107–131  ·  view source on GitHub ↗
(&self, event: CacheEvent)

Source from the content-addressed store, hash-verified

105
106 #[inline]
107 fn send_cache_event(&self, event: CacheEvent) {
108 let sent_event = self.sender.try_send(event.clone());
109
110 if let Err(ref err) = sent_event {
111 info!(
112 "Failed to send asynchronously message to worker thread, \
113 event: {event:?}, error: {err}"
114 );
115 }
116
117 #[cfg(test)]
118 {
119 let mut stats = self
120 .stats
121 .0
122 .lock()
123 .expect("Failed to acquire worker stats lock");
124
125 if sent_event.is_ok() {
126 stats.sent += 1;
127 } else {
128 stats.dropped += 1;
129 }
130 }
131 }
132
133 #[cfg(test)]
134 pub(super) fn events_dropped(&self) -> u32 {

Callers 2

on_cache_get_asyncMethod · 0.80
on_cache_update_asyncMethod · 0.80

Calls 4

is_okMethod · 0.80
cloneMethod · 0.45
expectMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected