Class: Sidekiq::CancellableWorker::WorkerContext

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/cancellable_worker.rb

Instance Method Summary collapse

Constructor Details

#initialize(jid) ⇒ WorkerContext

Returns a new instance of WorkerContext.



6
7
8
# File 'lib/sidekiq/cancellable_worker.rb', line 6

def initialize(jid)
  @jid = jid
end

Instance Method Details

#cancelled?Boolean

Returns:

  • (Boolean)


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

def cancelled?
  ::Sidekiq.redis { |c| c.exists("cancelled-#{@jid}") }
end