Sha256: 39d9568ade8987154673a6219258b2ad59229b23f225b263098f8a837e9c7bc4
Contents?: true
Size: 531 Bytes
Versions: 12
Compression:
Stored size: 531 Bytes
Contents
module Sidekiq::LimitFetch::Redis extend self # prevent blocking of fetcher # more bullet-proof and faster (O_O) # than using Celluloid::IO def nonblocking_redis redis do |redis| begin Celluloid::Future.new { yield redis }.value end end rescue Celluloid::Task::TerminatedError end def redis Sidekiq.redis {|it| yield it } end def determine_namespace redis do |it| if it.respond_to?(:namespace) and it.namespace it.namespace + ':' end end end end
Version data entries
12 entries across 12 versions & 1 rubygems