Skip to content
Max Schwenk edited this page Jul 14, 2017 · 5 revisions

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