Sha256: d5273608dd322e6c29de7e44486067bc177133380d80a735c1db5ec2ab4156c3

Contents?: true

Size: 913 Bytes

Versions: 15

Compression:

Stored size: 913 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/sidekiq/cobweb_helper')

# If your client is single-threaded, we just need a single connection in our Redis connection pool
#Sidekiq.configure_client do |config|
#  config.redis = { :namespace => 'x', :size => 1, :url => 'redis://localhost:6379/14' }
#end

# Sidekiq server is multi-threaded so our Redis connection pool size defaults to concurrency (-c)
#Sidekiq.configure_server do |config|
#  config.redis = { :namespace => 'x', :url => 'redis://localhost:6379/14' }
#end

class CrawlProcessWorker
  
  include Sidekiq::Worker

  sidekiq_options queue: "crawl_process_worker" if SIDEKIQ_INSTALLED
  
  def perform(content)
    content = HashUtil.deep_symbolize_keys(content)
    puts "Dummy Processing for #{content[:url]}"
  end
  def self.queue_size
    Sidekiq.redis do |conn|
      conn.llen("queue:#{get_sidekiq_options["queue"]}")
    end
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cobweb-1.2.1 lib/crawl_process_worker.rb
cobweb-1.2.0 lib/crawl_process_worker.rb
cobweb-1.1.0 lib/crawl_process_worker.rb
cobweb-1.0.29 lib/crawl_process_worker.rb
cobweb-1.0.28 lib/crawl_process_worker.rb
cobweb-1.0.27 lib/crawl_process_worker.rb
cobweb-1.0.26 lib/crawl_process_worker.rb
cobweb-1.0.25 lib/crawl_process_worker.rb
cobweb-1.0.24 lib/crawl_process_worker.rb
cobweb-1.0.23 lib/crawl_process_worker.rb
cobweb-1.0.22 lib/crawl_process_worker.rb
cobweb-1.0.21 lib/crawl_process_worker.rb
cobweb-1.0.20 lib/crawl_process_worker.rb
cobweb-1.0.19 lib/crawl_process_worker.rb
cobweb-1.0.18 lib/crawl_process_worker.rb