basic use of sidekiq (2)
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 }
end require 'sidekiq/web'
run Sidekiq::Web
执行
(1)方法1
bundle exec sidekiq
打开页面当前项目下启动http://localhost:3000/sidekiq
(2)
方法2
$ rackup
打开管理页面就可以看到了所有的任务了
http://localhost:9292/

可以在sidekiq启动的时候存入任务进程号
$bundle exec sidekiq -r ./worker.rb -P ~/tmp/sidekiq.pid
$cat ~/tmp/sidekiq.pid
1198
$ ps -ax | grep sidekiq
1198 pts/28 Sl+ 0:00 sidekiq 4.1.1 [0 of 25 busy]
1259 pts/33 S+ 0:00 grep --color=auto sidekiq
可以使用sidekiqctl关闭服务
$ sidekiqctl --help
sidekiqctl - stop a Sidekiq process from the command line. Usage: sidekiqctl <command> <pidfile> <kill_timeout>
where <command> is either 'quiet' or 'stop'
<pidfile> is path to a pidfile
<kill_timeout> is number of seconds to wait until Sidekiq exits
(default: 10), after which Sidekiq will be KILL'd Be sure to set the kill_timeout LONGER than Sidekiq's -t timeout. If you want
to wait 60 seconds for jobs to finish, use `sidekiq -t 60` and `sidekiqctl stop
path_to_pidfile 61`
$ sidekiqctl stop ~/tmp/sidekiq.pid
Sidekiq shut down gracefully.
basic use of sidekiq (2)的更多相关文章
- basic use of sidekiq
参考页面 https://github.com/mperham/sidekiq https://github.com/mperham/sidekiq/wiki/Getting-Started 强烈推荐 ...
- Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结
Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...
- Basic Tutorials of Redis(9) -First Edition RedisHelper
After learning the basic opreation of Redis,we should take some time to summarize the usage. And I w ...
- Basic Tutorials of Redis(8) -Transaction
Data play an important part in our project,how can we ensure correctness of the data and prevent the ...
- Basic Tutorials of Redis(7) -Publish and Subscribe
This post is mainly about the publishment and subscription in Redis.I think you may subscribe some o ...
- Basic Tutorials of Redis(6) - List
Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with t ...
- Basic Tutorials of Redis(5) - Sorted Set
The last post is mainly about the unsorted set,in this post I will show you the sorted set playing a ...
- Basic Tutorials of Redis(4) -Set
This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...
- Basic Tutorials of Redis(3) -Hash
When you first saw the name of Hash,what do you think?HashSet,HashTable or other data structs of C#? ...
随机推荐
- JAVA设计模式之1-单例模式
设计模式是什么? 设计模式是一种思路,是在前辈们的软件工程中总结出来的套路,并且这些套路已经经过很多项目的测试,是比较成熟的思路,所以现在来总结一下常见的设计模式. 最简单最常用的就是单例模式: 一般 ...
- codevs 3288 积木大赛
题目描述 Description 春春幼儿园举办了一年一度的"积木大赛".今年比赛的内容是搭建一座宽度为 n 的大厦,大厦可以看成由 n 块宽度为1的积木组成,第i块积木的最终高度 ...
- Android开发之应用程序的安装
这里介绍的是用XUtils下载apk文件,然后进行安装. 首先用HttpUtils下载文件(记得获取SD卡的读写权限和联网的权限): /** * 下载Apk */ private void downL ...
- Alpha阶段总结
Alpha阶段的验收已经完成,8个小组都展现了他们经过连夜奋战后的成果.相比过往几届,这是第一次8个小组全部顺利演示操作完成,没有个别小组因为任务未完成而延宕演示的情况发生.Alpha演示,各组都实现 ...
- Webpack:前端资源模块化管理和打包工具
一.介绍: Webpack 是当下最热门的前端资源模块化管理和打包工具.它可以将许多松散的模块按照依赖和规则打包成符合生 产环境部署的前端资源.还可以将按需加载的模块进行代码分隔,等到实际需要的时候再 ...
- jQuery--.wrap()方法
1. .wrap()方法:在每个匹配的元素外层包上一个html元素. 2. 有两种使用方法: .wrap(wrappingElement):其中wrappingElement可以是一个HTML片段,选 ...
- [转]ExtJS Grid 分页时保持选中的简单实现方法
原文地址 :http://www.qeefee.com/article/ext-grid-keep-paging-selection ExtJS中经常要用到分页和选择,但是当选择遇到分页的时候,杯具就 ...
- 读《单页web应用》-回顾作用域
js中没有块级作用域,只有全局作用域和函数作用域.全局变量可以在任何地方访问,局部变量只能在声明它的地方访问. var a=1; function func(){ var a=2; } console ...
- 基于Visual Studio Code搭建Golang开发调试环境【非转载】
由于对Docker+kubernetes的使用及持续关注,要理解这个平台的原理,势必需要对golang有一定的理解,基于此开始利用业余时间学习go,基础语法看完之后,搭建开发环境肯定是第一步,虽然能g ...
- thinkcmf无法使用config.html中的配置量
在模版中引入 <tc_include file=":config" />