Currently the global state management is done with a static state. It is convenient because the user can put non clonable data and get a 'static ref from any callback. However this should be completely avoided for the following reasons:
With multiple clients spawned, they are going to share the same state and this will probably lead to bugs. First example with all the integration tests for the socketioxide lib.
Currently the implementation uses unsafe code to do this. Moving to a per client clonable state remove this.
This will lead to a possible axum-like state implementation. Having only one typed state rather than the type erased typemap.
Currently the global state management is done with a static state. It is convenient because the user can put non clonable data and get a
'static ref
from any callback. However this should be completely avoided for the following reasons:typemap
.