Class: Sidekiq::BasicFetch::UnitOfWork

Inherits:
Struct
  • Object
show all
Defined in:
lib/sidekiq/fetch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jobObject

Returns the value of attribute job

Returns:

  • (Object)

    the current value of job



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

def job
  @job
end

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue



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

def queue
  @queue
end

Instance Method Details

#acknowledgeObject



10
11
12
# File 'lib/sidekiq/fetch.rb', line 10

def acknowledge
  # nothing to do
end

#queue_nameObject



14
15
16
# File 'lib/sidekiq/fetch.rb', line 14

def queue_name
  queue.sub(/.*queue:/, ''.freeze)
end

#requeueObject



18
19
20
21
22
# File 'lib/sidekiq/fetch.rb', line 18

def requeue
  Sidekiq.redis do |conn|
    conn.rpush("queue:#{queue_name}", job)
  end
end