Open segphault opened 8 years ago
Related to #23
I partially disagree with this part:
you don't want to handle that update for the user who sent the message because you want to optimistically display it on the client side first
There are some cases in which you will want to update locally even if you were the client that triggered the update. See #194 for two such examples.
There are a lot of cases (particularly when implementing ad hoc optimistic updates) where it would be useful to be able to tell if a given update was caused by action taken by the end user.
For example, when a user sends a message in a chat room, and that update is broadcast to all users, you don't want to handle that update for the user who sent the message because you want to optimistically display it on the client side first.
This is a common enough use case that a lot of realtime frameworks support it out of the box. A few precedents:
broadcast
flag that sends the message to everyone except the requesting socket: http://socket.io/docs/#broadcasting-messagesmessage
command has areq
property that serves the same function: http://sailsjs.org/documentation/reference/web-sockets/resourceful-pub-sub/message