MCPcopy Create free account
hub / github.com/buttplugio/buttplug / send_ping_msg

Method send_ping_msg

crates/buttplug_server/src/ping_timer.rs:103–114  ·  view source on GitHub ↗
(&self, msg: PingMessage)

Source from the content-addressed store, hash-verified

101 }
102
103 fn send_ping_msg(&self, msg: PingMessage) -> impl Future<Output = ()> + use<> {
104 let ping_msg_sender = self.ping_msg_sender.clone();
105 let max_ping_time = self.max_ping_time;
106 async move {
107 if max_ping_time == 0 {
108 return;
109 }
110 if ping_msg_sender.send(msg).await.is_err() {
111 error!("Cannot ping, no event loop available.");
112 }
113 }
114 }
115
116 pub fn start_ping_timer(&self) -> impl Future<Output = ()> + use<> {
117 self.send_ping_msg(PingMessage::StartTimer)

Callers 3

start_ping_timerMethod · 0.80
stop_ping_timerMethod · 0.80
update_ping_timeMethod · 0.80

Calls 2

cloneMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected