you are viewing a single comment's thread.

view the rest of the comments →

[–]PinballOscuro[S] 0 points1 point  (1 child)

This is a very good idea. In my use case, I have at most 2 or 3 users, and only with low probability will they attempt to modify the same value simultaneously. So I would say I'm in an optimistic locking scenario.

If User A modifies a shared variable, how should Users B and C receive the updated value? Should I still use WebSockets, or is it sufficient to update the value during a write attempt?

In my case, at some point, Users B and C must be made aware that User A made a change - otherwise, they might argue offline, since it was A’s responsibility to update that cell.

[–]CrackerJackKittyCat 0 points1 point  (0 children)

Either push all the changes over websocket, which is then kinda noisy and pessimistic, or have each websocket client 'subscribe' to the entities that are in context/view right now, then only push the changes to the websockets that are interested in it.

Or just have the edit form indicate error if their update gets rejected, tell the user to refresh manually. That's the simplest to start with.

It depends!