Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the delayed_job gem be used outside of Rails?

Is it possible to use the delayed_job gem outside of Rails? Or put another way, can it be used in a pure Ruby project?

If so, how?

like image 776
massinissa Avatar asked Feb 11 '11 23:02

massinissa


2 Answers

I don't know why this person never posted this.

It's easy. Two steps:

http://brkrd.com/post/45269754283/delayed-job-without-rails

UPDATE Looks like the link is broken.

You will need Active Record, but not Rails. You will have to mock a Rails object, and load your database information, environment, and root into the Rails object so that DelayedJob thinks it's in the Rails environment.

like image 81
Alex V Avatar answered Nov 10 '22 09:11

Alex V


Delayed Job looks heavily rails dependent. https://github.com/defunkt/resque resque is a very good gem that is not rails dependent that accomplishes the same goal. You do however have to have redis on your machine which is very lightweight. Resque also has a cool Sinatra web console to see what is going on.

like image 38
Michael Papile Avatar answered Nov 10 '22 10:11

Michael Papile