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)