A Rails based front-end to the Rescue job queue system.
Step 1:
- Create Gemfile with following entries and save
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.
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
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 :
1$rake - T resque2rake resque :failures:sort # Sort the 'failed' queue for the redis_multi_queue failure3backend4rake resque :work # Start a Resque worker5rake resque :workers # Start multiple Resque workers
If you skip this step, you will get the error:
1Don 't know how to build task ' resque:work ' in rails 4.x.
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
1root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ls2resque resqueweb3root@DEVSVNMBIZ:/var/lib/gems/1.9.1/gems/resque1.25.2/bin# ./resqueweb4[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



