Module: Sidekiq::Hol::Worker

Defined in:
lib/sidekiq/hol/worker.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'lib/sidekiq/hol/worker.rb', line 4

def self.included(base)
  raise ArgumentError, "You cannot include Sidekiq::Hol::Worker in an ActiveJob: #{base.name}" if base.ancestors.any? {|c| c.name == 'ActiveJob::Base' }

  base.include(Sidekiq::Worker) unless defined? base.perform_async
  base.extend(ClassMethods)
end