class Fluent::Plugin::PrometheusInput::AsyncWrapper::AsyncHttpWrapper
Public Class Methods
Source
# File lib/fluent/plugin/in_prometheus/async_wrapper.rb, line 24 def initialize(http) @http = http end
Public Instance Methods
Source
# File lib/fluent/plugin/in_prometheus/async_wrapper.rb, line 28 def get(path) error = nil response = Async::Task.current.async { begin @http.get(path) rescue => e # Async::Reactor rescue all error. handle it by itself error = e end }.wait if error raise error end Response.new(response.status.to_s, response.read || '', response.headers) end