Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Job options

jeffkreeftmeijer edited this page Sep 13, 2010 · 1 revision

When enqueueing a job, you can pass some options using the :job_options hash.

Priority

You can set the priority like this;

Navvy::Job.enqueue(Cow, :speak, :job_options => {:priority => 10})

You can put any Integer in the priority field. The highest one will be processed first.

Run at

You can enqueue jobs to run later. If you’re using Rails you can do;

Navvy::Job.enqueue(Cow, :speak, :job_options => {:run_at => 1.day.from_now})

If not, just do something like this;

Navvy::Job.enqueue(Cow, :speak, :job_options => {:run_at => Time.now + 86400})

Now your job will run tomorrow. :)

Clone this wiki locally