Class: Async::App::WebApps::HealthApp
- Inherits:
-
Object
- Object
- Async::App::WebApps::HealthApp
- Includes:
- AutoloadComponent, Async::App::WebComponent
- Defined in:
- lib/async/app/web_apps/health_app.rb
Constant Summary collapse
- PATHS =
["/health", "/health/"].freeze
Instance Method Summary collapse
Methods included from AutoloadComponent
Methods included from Async::App::WebComponent
Instance Method Details
#after_init ⇒ Object
9 10 11 12 |
# File 'lib/async/app/web_apps/health_app.rb', line 9 def after_init @healthy = false bus.subscribe("health.updated") { @healthy = _1 } end |
#call(_) ⇒ Object
15 |
# File 'lib/async/app/web_apps/health_app.rb', line 15 def call(_) = [@healthy ? 200 : 500] |
#can_handle?(request) ⇒ Boolean
14 |
# File 'lib/async/app/web_apps/health_app.rb', line 14 def can_handle?(request) = PATHS.include?(request.path) |