Module: Sidekiq::Throttled::Worker

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

Overview

Adds helpers to your worker classes

Examples:

Usage


class MyWorker
  include Sidekiq::Worker
  include Sidekiq::Throttled::Worker

  sidkiq_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(worker) ⇒ Object

Note:

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

Extends worker class with ClassMethods.



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

def self.included(worker)
  worker.send(:extend, ClassMethods)
end