Closed robertpi closed 4 years ago
I would say the same for terminate. Seems there's no easy way to know which socket is closing.
(Although I could be missing something obvious)
Suggested a possible implementation in this PR: https://github.com/SaturnFramework/Saturn/pull/227
I've actually thought I've added it to handle 😅
I definitely need access to the socket id in both handle and terminate, so we need to decide whether this merits a breaking change or not.
Oh, yes, Saturn is still before 1.0, so breaking changes are somehow expected from time to time.
Ok, this got merged, it will be released in next version of Saturn.
In some cases I'd like to be able to send a reply message just to the channel that sent it. Currently the handle does not take the socketId as a parameter, so this is quite difficult.
You can store the socketId when the user connects so be able to talk to the channels that are associated with a user, but since a user could open several pages and therefore several connections, you have do way to know which of the users connections send the original messages.