Sha256: 7223a9c85ba8bc5491c34fdc60ea19ab287d0ef76e5b6e972a089aa99164083d

Contents?: true

Size: 309 Bytes

Versions: 1

Compression:

Stored size: 309 Bytes

Contents

module Sidekiq::LimitFetch::Redis
  # prevent blocking of fetcher
  # more bullet-proof and faster (O_O)
  # than using Celluloid::IO
  def redis
    Sidekiq.redis do |redis|
      begin
        Celluloid::Future.new { yield redis }.value
      end
    end
  rescue Celluloid::Task::TerminatedError
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq-limit_fetch-2.0 lib/sidekiq/limit_fetch/redis.rb