A Rails based front-end to the Rescue job queue system.

Step 1:

  • Create Gemfile with following entries and save
gem ‘resque’
gem ‘resque-web’ , require: ‘resque_web’

Step 2:

  • Run below command to install from Gemfile.

Note : you should be in the directory where Gemfile is saved.

$bundle install

  • These packages are available in /var/lib/gems/1.9.1/gems/

Note: See to it that redis server is installed and running.

Step3:

  • In /var/lib/gems/1.9.1/gems/resque1.25.2

Create /lib/tasks/resque.rake and save it with below entries

require ‘resque/tasks’
task ‘resque:setup’ = > :environment

  • The require line will give you three rake tasks related to resque. The task line loads the Rails environment so that we can access ActiveRecord in the workers.

You can see the new tasks added by resque by doing :

$rake – T resque
rake resque :failures:sort # Sort the ‘failed’ queue for the redis_multi_queue failure
backend
rake resque :work # Start a Resque worker
rake resque :workers # Start multiple Resque workers

If you skip this step, you will get the error:

Don ‘t know how to build task ‘ resque:work ‘ in rails 4.x.

//Write your code here!

Now you can create jobs in app as per the task

Step 4:

  • resque is setup and functioning, now we can start resque dashboard.

Browse into following directory

root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ls
resque resqueweb
root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ./resqueweb
[2015-03-11 12:16:35 +0530] Starting ‘resqueweb’…
[2015-03-11 12:16:35 +0530] trying port 5678…

Now we can see dashboard at http://ipaddress:5678/

References:

https://www.rubyplus.com/articles/531
https://github.com/resque/resqueweb