All threads / Connect two rails apps with live updates hotwire, redis?
Ask A Question


You’re not receiving notifications from this thread.

Connect two rails apps with live updates hotwire, redis?

Gaizka asked in Rails


I am going to create a big project. Using GCP and Rails I'm willing to create management system for a company. Investigating I've managed to solve some problems that I figured out while creating de design of the arquitecture.
This is my schema. (The Core API runs in Rails too)

However I haven't be able to solve this one. I want to have live updates (like it is done with Hotwire). As it's difficult to explain my problem, I'll give some examples.

The Admin Actor wants to create the Invoices for all the clients. The frontend rails calls the backend api to start that job. The backend api adds the job to the Cloud Tasks Queue. The Cloud Task Worker executes it. If some User Actor is connected to their panel, I want to update their invoice with without having to refresh it manually.

However the CloudTask only creates the pdf, inserts it into de db. I need to have some way to communicate backwards, and I don't think callbacks are the best idea... Maybe redis? How could implement that to Hotwire?. Or I could just with stimulus auto refresh the page...

I want to use Hotwire but I don't know how.

Thank you very much.
Apologies for my English, I'm Spanish.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,099+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.