to be notifying the user for an asynchronous action, it was not clear specially with Rails apps what should be used in order to update the UI; execute a second, third or four action as consequence of a third party API or service. ❖ This approach started as part of refactoring to an existing approach, where we used a loop to check if there was a new update from the backend using a long polling technique to see if there was a new record or a new value.
updates a record The backend creates a SM BG Job Process new raster Process Enterprise Statistics Process Multiyear scenarios Notify the front-end Notify the front-end Notify the front-end
to check if something is new in the backend that will tell the front-end that it needs to be updated. ❖ Polling sets a loop with an interval of time and checks if there’s something new. ❖ Long Polling sends a requests to the backend and it comes back until there’s a response available.
server to the client in only one-way. ❖ It is supported for most of the browsers ❖ It was supported by Rails since 4.0 ❖ Persistent connection ❖ No internet Explorer
can be used without a lot of hassle to communicate between the backend and the browser, and the BG jobs and the browser. ❖ It works with long polling and polling, it supports multiple clients to the same channel. ❖ Used and tested with Discourse
❖ Great for our purpose ❖ Can be used server to server ❖ Can be used server to client ❖ It uses redis ❖ It uses polling/long polling ❖ Supports all the browsers ❖ No need to have a separate instance
MessageBus Client/ReactJS/Redux New Stack BG Jobs With AASM SK workers Processors State Machine that completes actions and communicate the changes to the client with MessageBus
an action needs to be performed outside of the web app: ❖ Outside of controllers, models, BG jobs ❖ No need to use another server process ❖ It can be used to broadcast or send messages to user ❖ It’s rock solid