Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 678 Bytes

File metadata and controls

20 lines (19 loc) · 678 Bytes

For retrieving which worker to call for each queue/message, Shoryuken uses DefaultWorkerRegistry, this is the default behavior, but if you have a special need, you can set a custom one.

class CustomWorkerRegistry
  def fetch_worker(queue, message)
    ...
    worker_class = begin
                     worker_class.constantize
                   rescue
                     [your Worker here]
                   end
    ...
  end
end

...and register it in your initializer

# config/initializers/shoryuken.rb
Shoryuken.worker_registry = CustomWorkerRegistry.new