class Sidekiq::Processor::SharedWorkState

jruby's Hash implementation is not threadsafe, so we wrap it in a mutex here

Public Class Methods

new() click to toggle source
# File lib/sidekiq/processor.rb, line 229
def initialize
  @work_state = {}
  @lock = Mutex.new
end

Public Instance Methods

clear() click to toggle source
# File lib/sidekiq/processor.rb, line 250
def clear
  @lock.synchronize { @work_state.clear }
end
delete(tid) click to toggle source
# File lib/sidekiq/processor.rb, line 238
def delete(tid)
  @lock.synchronize { @work_state.delete(tid) }
end
dup() click to toggle source
# File lib/sidekiq/processor.rb, line 242
def dup
  @lock.synchronize { @work_state.dup }
end
set(tid, hash) click to toggle source
# File lib/sidekiq/processor.rb, line 234
def set(tid, hash)
  @lock.synchronize { @work_state[tid] = hash }
end
size() click to toggle source
# File lib/sidekiq/processor.rb, line 246
def size
  @lock.synchronize { @work_state.size }
end