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 247 def initialize @work_state = {} @lock = Mutex.new end
Public Instance Methods
clear()
click to toggle source
# File lib/sidekiq/processor.rb, line 268 def clear @lock.synchronize { @work_state.clear } end
delete(tid)
click to toggle source
# File lib/sidekiq/processor.rb, line 256 def delete(tid) @lock.synchronize { @work_state.delete(tid) } end
dup()
click to toggle source
# File lib/sidekiq/processor.rb, line 260 def dup @lock.synchronize { @work_state.dup } end
set(tid, hash)
click to toggle source
# File lib/sidekiq/processor.rb, line 252 def set(tid, hash) @lock.synchronize { @work_state[tid] = hash } end
size()
click to toggle source
# File lib/sidekiq/processor.rb, line 264 def size @lock.synchronize { @work_state.size } end