Class: CrawlProcessWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/crawl_process_worker.rb

Overview

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 Method Summary collapse

Instance Method Summary collapse

Class Method Details

.queue_sizeObject



24
25
26
27
28
# File 'lib/crawl_process_worker.rb', line 24

def self.queue_size
  Sidekiq.redis do |conn|
    conn.llen("queue:#{get_sidekiq_options["queue"]}")
  end
end

Instance Method Details

#perform(content) ⇒ Object



20
21
22
23
# File 'lib/crawl_process_worker.rb', line 20

def perform(content)
  content = HashUtil.deep_symbolize_keys(content)
  puts "Dummy Processing for #{content[:url]}"
end