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



227
228
229
# File 'lib/resque/server.rb', line 227

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

Instance Method Details

#resqueObject



223
224
225
# File 'lib/resque/server.rb', line 223

def resque
  Resque
end

#show(page, layout = true) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/resque/server.rb', line 121

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



130
131
132
133
134
# File 'lib/resque/server.rb', line 130

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