I have a setup in my WASP project where a user clicks a button, and my app sends data from the WASP server to a separate Node endpoint. Each request includes a JobID (representing the batch) and multiple subtaskIDs (mapped to individual database entities).
I’ve set up a webhook in my WASP app to receive results from the Node server. The webhook invokes various server actions to updates the DB accordingly and tracks the status of the JobID and each subtaskID.
Now, I want certain components in the UI (the ones initiating the batch) to subscribe to these updates, ideally in realtime so that I can reflect the status/result of each subtaskID as it completes, without needing to refresh or rerender the entire page.
Re-rendering the entire page after a set amt of time is how it currently works, but this isn't sufficient because there are too many variables to reliably calculate how long a job will take like batch size, network latency, error handling/retries etc
What’s the best way to implement realtime, secure server to client communication in WASP?
Should I be looking into WebSockets, polling, or does WASP have a built in pattern for this kind of reactive update?
Any guidance or examples would be much appreciated!