Sha256: b801a8d1e4e2a78a399765eb609c05cadd35013b807d01b4eff362c388b01f3e

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module ResqueHelpers
  module Worker
    module_function

    def find_by_queue_name(queue_name)
      Resque::Worker.all.reduce([]) do |queues, worker|
        queues << worker if worker.queues.include? queue_name
        queues
      end
    end

    def find_by_name(name)
      Resque::Worker.all.reduce([]) do |queues, worker|
        queues << worker if worker.to_s == name
        queues
      end
    end

    def find_by_server_name(name)
      Resque::Worker.all.reduce([]) do |queues, worker|
        queues << worker if worker.to_s == name
        queues
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resque_helpers-0.0.1 lib/resque_helpers/worker.rb