Class: Sidekiq::CancellableWorker::WorkerContext
- Inherits:
-
Object
- Object
- Sidekiq::CancellableWorker::WorkerContext
- Defined in:
- lib/sidekiq/cancellable_worker.rb
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
-
#initialize(jid) ⇒ WorkerContext
constructor
A new instance of WorkerContext.
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
10 11 12 |
# File 'lib/sidekiq/cancellable_worker.rb', line 10 def cancelled? ::Sidekiq.redis { |c| c.exists("cancelled-#{@jid}") } end |