Basic use of SIDEKIQ (2)

Source: Internet
Author: User

Vim Gemfile
SOURCE "https://rubygems.org" gem "Sidekiq" Gem' rack-protection ' Gem ' Sinatra  '

Vim config.ru
Require ' sidekiq ' require ' rack-protection 'sidekiq.configure_client do |config|   Config.redis = {db:1 } endrequire ' Sidekiq/web 'run sidekiq::web   

Perform

(1) Method 1bundle exec Sidekiq open page under current project start Http://localhost:3000/sidekiq (2) method 2$ Rackup

Open the Admin page and you'll see all the tasks.

http://localhost:9292/

Can be saved to the task process number when Sidekiq is started

$bundle exec sidekiq-r./worker.rb-p ~/tmp/sidekiq.pid
$cat ~/tmp/sidekiq.pid1198
$ Ps-ax | grep sidekiq 1198 Pts/28   sl+    0:00 sidekiq 4.1.1  [0 of busy]                                                              1259 pts/33   s+     0:00 grep--color=auto sidekiq 

You can use SIDEKIQCTL to close the service

$ sidekiqctl--helpsidekiqctl-stop a sidekiq process from the command line. Usage:sidekiqctl <command> <pidfile> <kill_timeout> where <command> is either ' quiet ' or ' st Op '       <pidfile> is path to a pidfile <kill_timeout> was number of       seconds to wait until Sidekiq E Xits       (default:10), after which Sidekiq would be KILL ' d issure to set the kill_timeout longer than Sidekiq ' s-t Tim Eout. If you wantto wait seconds for jobs to finish, use ' sidekiq-t ' and ' sidekiqctl stop path_to_pidfile ' 
$ sidekiqctl Stop ~/tmp/sidekiq.pid Sidekiq shut down gracefully.

Basic use of SIDEKIQ (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.