I'm using tokio-tungstenite
for WebSocket connections, and I have a dispatch_global(event)
function that should dispatch an event to every connection, the blocking method for this is
for mut conn in self.conns.iter_mut() {
conn.send(message.clone()).await?;
}
self.conns
is a DashMap
and conn
is WebSocketStream
which implements Sink
, send
is SinkExt
's method from futures-rs
, so I'm stuck here because whatever I do will give me lifetime errors