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

Step 1:

  • Create Gemfile with following entries and save
Plain text
1gem 'resque'
2gem '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.

Plain text
1$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

Plain text
1require 'resque/tasks'
2task '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 :

Plain text
1$rake - T resque
2rake resque :failures:sort # Sort the 'failed' queue for the redis_multi_queue failure
3backend
4rake resque :work # Start a Resque worker
5rake resque :workers # Start multiple Resque workers

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

Plain text
1Don 't know how to build task ' resque:work ' in rails 4.x.
Plain text
1//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

JavaScript
1root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ls
2resque resqueweb
3root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ./resqueweb
4[2015-03-11 12:16:35 +0530] Starting 'resqueweb'...
5[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