class TreadMill::QueueListener

We want to subclass the JobWrapper to ensure the messages are deserialized properly.

Public Class Methods

for_queues(*queues) click to toggle source

Generate a worker for each queue specified.

# File lib/tread_mill/queue_listener.rb, line 12
def self.for_queues(*queues)
  queues.flatten.map do |queue|
    # Sneakers::Runner wants a worker class, not an instance.
    # So, here we are creating anonymous classes and setting the queue
    # accordingly.
    Class.new(QueueListener) do
      from_queue queue
    end
  end
end