Class: Resque::Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/resque/server.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.tabsObject



244
245
246
# File 'lib/resque/server.rb', line 244

def self.tabs
  @tabs ||= ["Overview", "Working", "Failed", "Queues", "Workers", "Stats"]
end

Instance Method Details

#resqueObject



240
241
242
# File 'lib/resque/server.rb', line 240

def resque
  Resque
end

#show(page, layout = true) ⇒ Object



131
132
133
134
135
136
137
138
# File 'lib/resque/server.rb', line 131

def show(page, layout = true)
  response["Cache-Control"] = "max-age=0, private, must-revalidate"
  begin
    erb page.to_sym, {:layout => layout}, :resque => Resque
  rescue Errno::ECONNREFUSED
    erb :error, {:layout => false}, :error => "Can't connect to Redis! (#{Resque.redis_id})"
  end
end

#show_for_polling(page) ⇒ Object



140
141
142
143
144
# File 'lib/resque/server.rb', line 140

def show_for_polling(page)
  content_type "text/html"
  @polling = true
  show(page.to_sym, false).gsub(/\s{1,}/, ' ')
end