Totodore / socketioxide

A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.

Home Page:https://docs.rs/socketioxide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make the handlers take a `&Socket` rather than an `Arc<Socket>`

Totodore opened this issue · comments

it would be a lot more user friendly to give a &Socket to the user rather than an Arc<Socket> because thanks to that the user cannot clone the Arc and hold a ref that would lead to a memory leak if he doesn't drop the ref when the socket is disconnecting.

It should be the same with socket references returned by the io struct calls.