<% @subtabs = worker_hosts.keys.sort unless worker_hosts.size == 1 %> <% if params[:id] && worker = Resque::Worker.find(params[:id]) %>

Worker <%= worker %>

<% host, pid, queues = worker.to_s.split(':') %>
  Host Pid Started Queues Processed Failed Processing
<%= state %><%= host %> <%= pid %> <%= worker.started %> <%= queues.split(',').map { |q| '' + q + ''}.join('') %> <%= worker.processed %> <%= worker.failed %> <% data = worker.processing || {} %> <% if data['queue'] %> <%= data['payload']['class'] %> "><%= data['run_at'] %> <% else %> Waiting for a job... <% end %>
<% elsif params[:id] && !worker_hosts.keys.include?(params[:id]) && params[:id] != 'all' %>

Worker doesn't exist

<% elsif worker_hosts.size == 1 || params[:id] %> <% if worker_hosts.size == 1 || params[:id] == 'all' %> <% workers = Resque.workers %> <% else %> <% workers = worker_hosts[params[:id]].map { |id| Resque::Worker.find(id) } %> <% end %>

<%= workers.size %> Workers

The workers listed below are all registered as active on your system.

<% for worker in (workers = workers.sort_by { |w| w.to_s }) %> <% host, pid, queues = worker.to_s.split(':') %> <% end %> <% if workers.empty? %> <% end %>
  Where Queues Processing
<%= state %>"><%= host %>:<%= pid %> <%= queues.split(',').map { |q| '' + q + ''}.join('') %> <% data = worker.processing || {} %> <% if data['queue'] %> <%= data['payload']['class'] %> "><%= data['run_at'] %> <% else %> Waiting for a job... <% end %>
There are no registered workers
<%=poll%> <% else %> <% @subtabs = [] %>

Workers

The hostnames below all have registered workers. Select a hostname to view its workers, or "all" to see all workers.

<% for hostname, workers in worker_hosts.sort_by { |h,w| h } %> <% end %>
Hostname Workers
"><%= hostname %> <%= workers.size %>
">all workers <%= Resque.workers.size %>
<% end %>