class Seahorse::Client::Plugins::RequestCallback::ReadCallbackHandler
@api private
def add_event_listeners(context)
def add_event_listeners(context) # unwrap the request body as soon as we start receiving a response context.http_response.on_headers do body = context.http_request.body if body.is_a? ReadCallbackIO context.http_request.body = body.io end end end
def call(context)
def call(context) if (callback = context[:on_chunk_sent]) context.http_request.body = ReadCallbackIO.new( context.http_request.body, callback ) add_event_listeners(context) end @handler.call(context) end