Can a server join a GetInstant room in order to get notified of changes?

StackOverflow https://stackoverflow.com/questions/21270182

  •  30-09-2022
  •  | 
  •  

Pregunta

Can a server join a room in order to get notified of changes?

Usecase: A user updates a field A, for which another calculated field B must be updated. However only the server is able (has the rules) to calculate the field B based on A.

What I mean would be the following flow:

  1. user updates field A.
  2. gets synced to GetInstant
  3. GetInstant notifies all users in the room among which the server, of the changed field A
  4. Server calculates field B
  5. field B gets synced to GetInstant
  6. (optional: clients get notified of updates of field B)

As a workaround I could let all updates go through by own server and do the plumbing myself, but I'd rather not. Moreover, directing traffic like this is costly for the sporadic case that I need to do these calculated field transforms.

¿Fue útil?

Solución

At the moment you can't join a room via the rest api and register for notifications server-side. This is on the roadmap, however. Currently your options to do this serverside are limited to polling.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top