S
S
Semyon Semyonov2017-03-13 10:56:23
Ruby on Rails
Semyon Semyonov, 2017-03-13 10:56:23

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

2 answer(s)
R
Roman Mirilaczvili, 2017-03-13
@2ord

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.

A
Andrey Demidenko, 2017-03-14
@Dem1

Look wisper

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question