Hi,
rufus-scheduler was never meant as a "background job processing
solution for rails", it's only a simple ruby gem for scheduling pieces
of code. It was originally developed for a workflow engine
(http://openwferu.rubyforge.org/)
> It's my understanding that the scheduler runs in it's own thread and that
> each one of the tasks has their thread too. Given that ruby does not have
> true multithreading I am wondering if this can ever block the rest of rails
> code?
Yes, the scheduler has his own thread. When a task gets triggered, it
executes in its own thread.
Yes, it can potentially block the rest of your rails code.
> If I schedule a task that takes a massively long time what happens?
When it gets triggered it will block the rest of your rails code probably.
It's your responsibility to make the task play nicely with other
threads or to completely offload that from the main application (then
you could simply use cron).
play with that gist : http://gist.github.com/64947 (run it as is and
then with the Thread.pass uncommented).
> Also what happens under mod_rails (passenger)? Are all your tasks running
> on all the processes?
No idea, I don't know anything about the threading / processing model
used by mod_rails.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com