class Async::HTTP::Body::Streamable
Invokes a callback once the body has finished reading.
def self.wrap(message, &block)
def self.wrap(message, &block) if message and message.body message.body = self.new(message.body, block) else yield end end
def initialize(body, callback)
def initialize(body, callback) super(body) @callback = callback end
def read
def read unless chunk = super @callback.call end return chunk end
def stop(*)
def stop(*) super @callback.call end