class Sidekiq::Batch::Status

Attributes

bid[R]

Public Class Methods

new(bid) click to toggle source
# File lib/sidekiq/batch/status.rb, line 6
def initialize(bid)
  @bid = bid
end

Public Instance Methods

child_count() click to toggle source
# File lib/sidekiq/batch/status.rb, line 42
def child_count
  Sidekiq.redis { |r| r.hget("BID-#{bid}", 'children') }.to_i
end
complete?() click to toggle source
# File lib/sidekiq/batch/status.rb, line 38
def complete?
  'true' == Sidekiq.redis { |r| r.hget("BID-#{bid}", 'complete') }
end
created_at() click to toggle source
# File lib/sidekiq/batch/status.rb, line 22
def created_at
  Sidekiq.redis { |r| r.hget("BID-#{bid}", 'created_at') }
end
data() click to toggle source
# File lib/sidekiq/batch/status.rb, line 46
def data
  {
    bid: bid,
    total: total,
    failures: failures,
    pending: pending,
    created_at: created_at,
    complete: complete?,
    failure_info: failure_info,
    parent_bid: parent_bid,
    child_count: child_count
  }
end
failure_info() click to toggle source
# File lib/sidekiq/batch/status.rb, line 34
def failure_info
  Sidekiq.redis { |r| r.smembers("BID-#{bid}-failed") } || []
end
failures() click to toggle source
# File lib/sidekiq/batch/status.rb, line 18
def failures
  Sidekiq.redis { |r| r.scard("BID-#{bid}-failed") }.to_i
end
join() click to toggle source
# File lib/sidekiq/batch/status.rb, line 10
def join
  raise "Not supported"
end
parent_bid() click to toggle source
# File lib/sidekiq/batch/status.rb, line 30
def parent_bid
  Sidekiq.redis { |r| r.hget("BID-#{bid}", "parent_bid") }
end
pending() click to toggle source
# File lib/sidekiq/batch/status.rb, line 14
def pending
  Sidekiq.redis { |r| r.hget("BID-#{bid}", 'pending') }.to_i
end
total() click to toggle source
# File lib/sidekiq/batch/status.rb, line 26
def total
  Sidekiq.redis { |r| r.hget("BID-#{bid}", 'total') }.to_i
end