After some initial use in a more production like environment, we have identified some improvements to the API which we want to make.
The http request context of the Socket is now available in the event handlers. This is useful for when you have added a user token to the request context, or any other metadata you are passing around from middleware
The connected attribute in the mount function has been moved to the Socket. Socket.Connected() bool
The Self func on the Handler has been removed, Socket.Self should be used instead.
The Socket now has Socket.Self and Socket.Broadcast these should be favoured for communicating. Handler.Broadcast remains, as it could be useful for communicating from another process.
After some initial use in a more production like environment, we have identified some improvements to the API which we want to make.
Socket.Connected() bool
Self
func on the Handler has been removed,Socket.Self
should be used instead.Socket.Self
andSocket.Broadcast
these should be favoured for communicating.Handler.Broadcast
remains, as it could be useful for communicating from another process.