Skip to main content
Version: v3.0

Background Jobs

ActiveJob backed by Resque is the basis for background and scheduled jobs in Rhino Jobs.

Installation

rails rhino_jobs:install

Creating a job

rails g job Test

Running a job

TestJob.perform_later

Scheduling a job

Edit resque_schedule.yml. See https://github.com/JustinAiken/active_scheduler for more details.

Processing the queue

A worker for the queued jobs can be executed with:

COUNT=1 QUEUE=* bundle exec rails resque:workers

A worker to queue scheduled jobs can be executed with:

bundle exec rails resque:scheduler

Heroku

On Heroku, Procfile is already updated to launch both a worker and a scheduler.