10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/em-resque.rb', line 10
def self.initialize_redis(server, namespace = :resque, pool_size = 1)
case server
when String
redis = EventMachine::Synchrony::ConnectionPool.new(:size => pool_size) do
EM::Hiredis.connect(server)
end
Resque.redis = Redis::Namespace.new(namespace, :redis => redis)
when Redis::Namespace
Resque.redis = server
else
redis = EventMachine::Synchrony::ConnectionPool.new(:size => pool_size) do
server
end
Resque.redis = Redis::Namespace.new(namespace, :redis => redis)
end
end
|