Class: Exekutor::Internal::StatusServer::App

Inherits:
Object
  • Object
show all
Defined in:
lib/exekutor/internal/status_server.rb

Overview

The Rack-app for the health-check server

Instance Method Summary collapse

Constructor Details

#initialize(worker, heartbeat_timeout) ⇒ App

Returns a new instance of App.



88
89
90
91
# File 'lib/exekutor/internal/status_server.rb', line 88

def initialize(worker, heartbeat_timeout)
  @worker = worker
  @heartbeat_timeout = heartbeat_timeout
end

Instance Method Details

#call(env) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/exekutor/internal/status_server.rb', line 93

def call(env)
  case Rack::Request.new(env).path
  when "/"
    render_root
  when "/ready"
    render_ready
  when "/live"
    render_live
  when "/threads"
    render_threads
  else
    [404, {}, ["Not found"]]
  end
end