Rails simple newsletter / mailing list with email notification of new search results

My users can save preferred queries. Now I need to give them the opportunity to subscribe to them in order to be notified by email when new search results appear (e.g. Yahoo responses).

I have already configured Mailer , which, when started manually, works fine.

Now all I have to do is call the mailer from a scheduled task but ... I'm really not an expert in this area. So, among Whenever , Delayed_job , Sidekiq , Resque Scheduler and co. with which one (or a combination of them) should I go for this task (a lengthy process with several mailings)?

EDIT

I developed a working example application available on Github: NotiSearch .

This is pretty well documented, so if you are trying to develop something like this, I definitely recommend that you check it out.

PS: I decided to rely on delayed_job every time , since they have no external dependencies, if necessary it’s easy enough to switch to a more scalable solution,

0
source share
2 answers

I personally worked with Resque and Sidekiq. The main difference between the two is that Sidekiq creates new threads for each job.

Resque has a process for every job. This basically means that Resque implies a failure, and the other jobs will not fail if one of the processes fails. Sidekiq, since it works with threads, if one of these threads is blocked for any reason, the whole process will be blocked.

From the answer in another QA Resque vs Sidekiq?

Resque:

Pros:

does not require thread safety (works with almost any stone); does not have a preference for a translator (you can use any ruby); many plugins. Minuses

Starts a process for one employee (uses more memory); does not perform repeated tasks (in any case). Sidekiq:

Arguments

starts a thread per worker (uses much less memory); less forking (faster); more options out of the box. Minuses

[huge] requires thread safety for your code and all dependencies. If you are running unsafe code with threads, you are asking for trouble; much fewer plugins (at the moment there are only 2); works on some rubies better than others (recommended by jruby and rubinius, efficiency on MRI is reduced due to GVL (global VM lock)).

EDIT

In any case, to answer your question. In all projects that we used email programs, we use Resque.

+2
source

Try MailyHerald , the gem of mailing list management for rails. This will allow you to configure periodic mailing sent to users only if certain conditions are met - that is, new search results are available.

MailyHerald processes all mailings automatically in the background (using Sidekiq) and provides a nice web-based management interface.

0
source

All Articles