here's my problem:
I have a table with lots of emails to be sent at specified dates, and
I want a process that checks, let's say every hour or so, that table
for mails to be sent, sends them and delete the records...
A very simple background process that call's a method. If there was a
way of doing this not in background it'd be ok, I don't care if it
gets stuck every hour for a few seconds..
I know about remoterb, but really.. isn't there an easier way? I don't
want to spend too much time on this stuff!
That thing is too big! And it's meant for delivering mails like a
queue. I want to deliver them only when it's time, they might stay
there for months, years..
Is there a way that doesn't involve plugins, or just small ones?
like a thread.do stuff.. I don't know..
Basically this thread just loops forever. It wakes up and checks for
stuff to do by asking the database
"Notification.find(:all, :conditions => 'b_distribute = true').each do
n>"
So for me I have a table called Notifications that things get inserted
into by my application. If they want batch mode distribution, they
set b_distribute = true. This thing gets them, does some mojo and
then sends out notifications. Don't get caught up in my crazy code as
much as the idea of a Daemon thread you start that loops and does your
stuff. My app has about 4 of this bad boys running checking incoming
email, sending email, gathering SMS messages, etc.
"Even deliviring email to the local machine may take too long when you have to send hundreds of messages. ar_mailer allows you to store messages into the database for later delivery by a separate process, ar_sendmail."