the rufus gems seems really cool for scheduled tasks and there are at
least a half a dozen projects for background tasks. Does anybody have
any experience with any of these?
So how do you deal with background tasks? I have read that simply
firing off a thread or attempting to fork is not a good way to go.
This one looks pretty decent and lightweight.
What are you guys using for background and scheduled tasks?
Wow lots of cool stuff there.
I'll watch a bunch of them tonight.
Old thread, I know :)
Just came upon this, about how the github deal with the issue of
background tasks
http://github.com/blog/542-introducing-resque
Cheers
Gordon
Our needs were much simpler and a little more specific so I rolled my
own. Basically it consists of a daemon you "poke" with a UDP packet
which contains a tiny bit of information like the type and the
database ID. The daemon pulls the record from the database and then
instantiates the object and calls the method specified in record with
the params in the record.
The thing that was different for me was the integration of
rufus-scheduler. I have a table called "scheduled_tasks" which
describe the job to be run and the schedule to run them. When the
model updates the record it poked the daemon which schedules the job.
The scheduled task simply creates a job record when the time is right
(related to the scheduled_)task) and pokes the daemon again which runs
the job.
This allows me to keep scheduled tasks on a per client basis and also
allows me to store the result every run of a scheduled task.
The daemon is written with eventmachine.
So far it's worked OK. No major problems for the volume of tasks I am running.
If I had a massive workload I would definitely look at gearman though.
http://gearman.org/
The nice thing about gearman is that you can run multiple gearman
instances so you have no single point of failure.
http://www.linux-mag.com/id/7330
If anybody uses it please let us know how it works out :)