1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Clean up examples

This commit is contained in:
Mike Perham 2012-04-02 19:21:26 -07:00
parent 41e20588b1
commit 2e58b1d9d8
4 changed files with 10 additions and 8 deletions

View file

@ -5,5 +5,5 @@
:verbose: false :verbose: false
:concurrency: 25 :concurrency: 25
:queues: :queues:
- [often, 2] - often
- [seldom, 1] - seldom

View file

@ -2,12 +2,12 @@ require 'sidekiq'
# If your client is single-threaded, we just need a single connection in our Redis connection pool # If your client is single-threaded, we just need a single connection in our Redis connection pool
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|
config.redis = Sidekiq::RedisConnection.create(:namespace => 'x', :size => 1, :url => 'redis://redis.host:1234/14') config.redis = { :namespace => 'x', :size => 1, :url => 'redis://redis.host:1234/14' }
end end
# Sidekiq server is multi-threaded so our Redis connection pool size defaults to concurrency (-c) # Sidekiq server is multi-threaded so our Redis connection pool size defaults to concurrency (-c)
Sidekiq.configure_server do |config| Sidekiq.configure_server do |config|
config.redis = Sidekiq::RedisConnection.create(:namespace => 'x', :url => 'redis://redis.host:1234/14') config.redis = { :namespace => 'x', :url => 'redis://redis.host:1234/14' }
end end
# Start up sidekiq via # Start up sidekiq via

View file

@ -5,8 +5,10 @@
# and then browse to http://localhost:4567 # and then browse to http://localhost:4567
# #
require 'sinatra' require 'sinatra'
require 'sidekiq/worker' require 'sidekiq'
$redis = Sidekiq::RedisConnection.create require 'redis'
$redis = Redis.connect
class SinatraWorker class SinatraWorker
include Sidekiq::Worker include Sidekiq::Worker

View file

@ -5,5 +5,5 @@
:pidfile: /tmp/sidekiq-config-test.pid :pidfile: /tmp/sidekiq-config-test.pid
:concurrency: 50 :concurrency: 50
:queues: :queues:
- [often, 2] - often
- [seldom, 1] - seldom