class Async::HTTP::Body

def close

def close
	self.enqueue(nil)
end

def closed?

def closed?
	@closed
end

def each

def each
	return if @closed
	
	while chunk = self.dequeue
		yield chunk
	end
	
	@closed = true
end

def initialize

def initialize
	super
	
	@closed = false
end

def read

def read
	buffer = Async::IO::BinaryString.new
	
	self.each do |chunk|
		buffer << chunk
	end
	
	return buffer
end

def write(chunk)

def write(chunk)
	self.enqueue(chunk)
end