Module: Wurk::Job

Included in:
Sidekiq::ActiveJob::Wrapper, Batch::CallbackJob, Batch::Empty
Defined in:
lib/wurk/job.rb,
lib/wurk/job/options.rb

Overview

Sidekiq 7+ alias for Wurk::Worker. ‘include Wurk::Job` and `include Sidekiq::Job` are the same surface.

Instance-level ‘jid`, `_context`, `interrupted?`, and `logger` come from Wurk::Worker. Class-level DSL (`sidekiq_options`, `perform_*`, `set`, retry blocks) does too — Job is a pure alias module that re-exposes Worker under the modern name.

Defined Under Namespace

Modules: Options Classes: Interrupted

Constant Summary collapse

Setter =

Per-call option carrier returned by ‘set(…)`. Sidekiq 7+ documents it under the modern mixin name `Sidekiq::Job::Setter`; since `Sidekiq::Job = Wurk::Job`, this rebind is what makes that constant resolve (without it `Sidekiq::Job::Setter` raises NameError). Same class as `Sidekiq::Worker::Setter`. Spec: docs/target/sidekiq-free.md §6.3.

Wurk::Worker::Setter
Iterable =

Sidekiq drop-in: upstream homes the iterable module (and its enumerator classes) under ‘Sidekiq::Job::Iterable`. Since `Sidekiq::Job == Wurk::Job`, mirror that so `Sidekiq::Job::Iterable::CsvEnumerator` / `…::ActiveRecordEnumerator` resolve for ported code.

IterableJob
InterruptHandler =

Sidekiq exposes this middleware as ‘Sidekiq::Job::InterruptHandler`. Mirror that name onto `Wurk::Job` (aliased to `Sidekiq::Job` in compat) so the drop-in constant resolves. Spec: docs/target/sidekiq-free.md §10.3.

Wurk::Middleware::InterruptHandler

Class Method Summary collapse

Class Method Details

.clear_allObject



38
# File 'lib/wurk/job.rb', line 38

def self.clear_all  = Wurk::Worker.clear_all

.drain_allObject



39
# File 'lib/wurk/job.rb', line 39

def self.drain_all  = Wurk::Worker.drain_all

.included(base) ⇒ Object



31
32
33
# File 'lib/wurk/job.rb', line 31

def self.included(base)
  base.include(Wurk::Worker)
end

.jobsObject

Mirror the module-level test helpers so ‘Sidekiq::Job.jobs / clear_all / drain_all` work the same as `Sidekiq::Worker.*`.



37
# File 'lib/wurk/job.rb', line 37

def self.jobs       = Wurk::Worker.jobs