Class: Sidekiq::ReliableFetch

Inherits:
BaseReliableFetch show all
Defined in:
lib/sidekiq/reliable_fetch.rb

Constant Summary collapse

RELIABLE_FETCH_IDLE_TIMEOUT =

For reliable fetch we don’t use Redis’ blocking operations so we inject a regular sleep into the loop.

5

Constants inherited from BaseReliableFetch

BaseReliableFetch::DEFAULT_CLEANUP_INTERVAL, BaseReliableFetch::DEFAULT_LEASE_INTERVAL, BaseReliableFetch::DEFAULT_MAX_RETRIES_AFTER_INTERRUPTION, BaseReliableFetch::HEARTBEAT_INTERVAL, BaseReliableFetch::HEARTBEAT_LIFESPAN, BaseReliableFetch::HEARTBEAT_RETRY_DELAY, BaseReliableFetch::LEASE_KEY, BaseReliableFetch::SCAN_COUNT, BaseReliableFetch::WORKING_QUEUE_PREFIX

Instance Attribute Summary collapse

Attributes inherited from BaseReliableFetch

#cleanup_interval, #last_try_to_take_lease_at, #lease_interval, #queues, #strictly_ordered_queues, #use_semi_reliable_fetch

Instance Method Summary collapse

Methods inherited from BaseReliableFetch

bulk_requeue, clean_working_queue!, clean_working_queues!, heartbeat, heartbeat_key, hostname, interruption_exhausted?, max_retries_after_interruption, pid, preprocess_interrupted_job, requeue_job, #retrieve_work, send_to_quarantine, setup_reliable_fetch!, start_heartbeat_thread, with_connection, worker_dead?, working_queue_name

Constructor Details

#initialize(options) ⇒ ReliableFetch

Returns a new instance of ReliableFetch.



11
12
13
14
15
16
# File 'lib/sidekiq/reliable_fetch.rb', line 11

def initialize(options)
  super

  @queues_size = queues.size
  @queues_iterator = queues.cycle
end

Instance Attribute Details

#queues_iteratorObject (readonly)

seconds



9
10
11
# File 'lib/sidekiq/reliable_fetch.rb', line 9

def queues_iterator
  @queues_iterator
end

#queues_sizeObject (readonly)

seconds



9
10
11
# File 'lib/sidekiq/reliable_fetch.rb', line 9

def queues_size
  @queues_size
end