How to trigger ActionCable/Database commit from outside of a rails app

Viewed 94

I have a rails 7 app setup with Hotwire and Actioncable to broadcast database commits to update the user interface in realtime.

I have a separate app (written in Python) that I want to use to send updates to the rails app.

If I write directly to the database then I won't be able to trigger the user interface to update automatically.

I've looked into maybe using an RPC call using RabbitMQ but I'm not currently using it in my environment so it may be too much overhead.

I'm wondering - how can I do this from outside of the rails app?

  • Internal API endpoint
  • RPC call

Thanks

1 Answers

I would use an internal API/Webhook inside of your rails app that could accept incoming requests and then do whatever you need to do with the data. From their you could add some token based authentication to make sure only the people you want to access the API can.

Related