Can I Use a Delayed Pearl Outside of Rails?

Can I use delay attenuation outside of Rails? Or else, can it be used in a pure Ruby project?

If so, how?

+7
source share
2 answers

I do not know why this person never wrote this.

It is easy. Two steps:

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

UPDATE The link seems to be broken.

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

+3
source

The deferred task is highly dependent on the rails. https://github.com/defunkt/resque resque is a very good stone that is not dependent on rails, which fulfills the same goal. However, you must have redis on your machine, which is very light. Resque also has a cool Sinatra web console to see what happens.

+3
source

All Articles