Answer the question
In order to leave comments, you need to log in
What are the patterns or ways to do notifications in Rails?
There was a need to make notifications and notifications of different types in different directions. I could hang everything in after_create, but I think this is the way of the loser. Tell me where to read or what keywords to search for best practices on the topic? I understand that you need some kind of ActiveMQ-type queue service or some services, I don’t know. Maybe someone came across and will give a recommendation? On mind it would be desirable, but without fanaticism.
Answer the question
In order to leave comments, you need to log in
Read about ActiveJob in the Rails guide. From simple backends to ActiveJob, I repeatedly use DelayedJob, which does not require the installation of additional DBMS to store queue data.
You can "hang in after_create" adding a task to the queue. This task will be asynchronously processed by another process and the client will not have to wait for it to wait.
I would like to clarify: notifications should occur within the application, between objects? Or over the network?
If the former, then try
https://github.com/krisleech/wisper
https://github.com/kevinrutherford/event_bus
If the latter, then using message queue technologies (ZMQ, AMQP), Redis pub/sub, WebSocket and corresponding gems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question