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


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

def job
  @job
end

#queueObject

Returns the value of attribute queue

Returns:

  • (Object)

    the current value of queue


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

def queue
  @queue
end

Instance Method Details

#acknowledgeObject


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

def acknowledge  # nothing to do

end

#queue_nameObject


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

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

#requeueObject


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

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