Module: Sidekiq::Throttled::Job

Defined in:
lib/sidekiq/throttled/job.rb

Overview

Adds helpers to your worker classes

Examples:

Usage


class MyJob
  include Sidekiq::Job
  include Sidekiq::Throttled::Job

  sidekiq_options :queue => :my_queue
  sidekiq_throttle :threshold => { :limit => 123, :period => 1.hour }

  def perform
    # ...
  end
end

See Also:

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Note:

Using ‘included` hook with extending worker with ClassMethods in order to make API inline with `include Sidekiq::Job`.

Extends worker class with ClassMethods.



32
33
34
# File 'lib/sidekiq/throttled/job.rb', line 32

def self.included(base)
  base.extend(ClassMethods)
end