Module: ResqueWeb::WorkersHelper

Defined in:
app/helpers/resque_web/workers_helper.rb

Instance Method Summary collapse

Instance Method Details

#worker_hostsObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/helpers/resque_web/workers_helper.rb', line 3

def worker_hosts
  @worker_hosts ||= begin
    hosts = Hash.new { [] }

    Resque.workers.each do |worker|
      host, _ = worker.to_s.split(':')
      hosts[host] += [worker.to_s]
    end

    hosts
  end
end