I’ve created an app using AppGyver. In this app, two users can belong to the same given group and therefore can access and manipulate the same data. At the moment, if Bob creates a new record in a table, Alice would need to send a GET request to the API to retrieve it. Of course, the problem is that Alice does not necessarily know when Bob has created a new record, so she would need to be constantly sending requests to the API to retrieve the latest data, which would be a waste of resources.
I figured this is a problem which can easily be solved using subscriptions using something like WebSockets or HTTP Streaming. However, I’m still trying to understand whether and how could I use the Publish-Subscribe Messaging REST API to solve this problem. Ideally, Alice subscribes to receive messages from the server which let her know when the data has changed, which then allows her to send a request to retrieve the data only when necessary.
However, looking a the documentation it suggests that even after subscribing to a channel, I will still need to send GET requests to retrieve messages every 60 seconds, which defeats the point of having a subscription in the first place, since I could simply send a GET request to query the table every 60 seconds.
What am I missing?