module Sidekiq::Throttled::Worker

Adds helpers to your worker classes

@example 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 ClassMethods

Public Class Methods

included(worker) click to toggle source

Extends worker class with {ClassMethods}.

@note Using `included` hook with extending worker with {ClassMethods}

in order to make API inline with `include Sidekiq::Worker`.

@private

# File lib/sidekiq/throttled/worker.rb, line 32
def self.included(worker)
  worker.send(:extend, ClassMethods)
end