class Sidekiq::Processor::SharedWorkerState
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 214 def initialize @worker_state = {} @lock = Mutex.new end
Public Instance Methods
clear()
click to toggle source
# File lib/sidekiq/processor.rb, line 235 def clear @lock.synchronize { @worker_state.clear } end
delete(tid)
click to toggle source
# File lib/sidekiq/processor.rb, line 223 def delete(tid) @lock.synchronize { @worker_state.delete(tid) } end
dup()
click to toggle source
# File lib/sidekiq/processor.rb, line 227 def dup @lock.synchronize { @worker_state.dup } end
set(tid, hash)
click to toggle source
# File lib/sidekiq/processor.rb, line 219 def set(tid, hash) @lock.synchronize { @worker_state[tid] = hash } end
size()
click to toggle source
# File lib/sidekiq/processor.rb, line 231 def size @lock.synchronize { @worker_state.size } end