Closed uwejan closed 1 year ago
This solely depends on your needs. Generally it's not specific to tungstenite
or tokio-tungstenite
, but a regular way to work with thread and Send
and Sync
in Rust. I.e. you could wrap it in Mutex
and wrap Mutex
in Arc
if that's the behavior that you expect.
We've had the same question some time ago: https://github.com/snapview/tokio-tungstenite/issues/123#issuecomment-1163263205
I wonder if there is a way to have
sink
as mutable and being able to clone it.Semilare issue with actix mentioned a while a go, which suggested using tokio Framed. https://github.com/actix/actix/issues/371