Class: Sidekiq::ReliableJob::Enqueuer

Inherits:
Object
  • Object
show all
Includes:
Component
Defined in:
lib/sidekiq/reliable_job/enqueuer.rb

Overview

Background thread that continuously processes the Outbox.

Constant Summary collapse

POLL_INTERVAL =
0.1
ERROR_SLEEP =
1
LOCK_RETRY_SLEEP =
20

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Enqueuer

Returns a new instance of Enqueuer.



15
16
17
18
19
# File 'lib/sidekiq/reliable_job/enqueuer.rb', line 15

def initialize(config)
  @config = config
  @done = false
  @processor = OutboxProcessor.new
end

Instance Method Details

#startObject



21
22
23
# File 'lib/sidekiq/reliable_job/enqueuer.rb', line 21

def start
  @thread = Thread.new { run }
end

#stopObject



25
26
27
# File 'lib/sidekiq/reliable_job/enqueuer.rb', line 25

def stop
  @done = true
end