Method: EventMachine::HttpResponse#chunk

Defined in:
lib/evma_httpserver/response.rb

#chunk(text) ⇒ Object

add a chunk to go to the output. Will cause the headers to pick up “content-transfer-encoding” Add the chunk to a list. Calling #send_chunks will send out the available chunks and clear the chunk list WITHOUT closing the connection, so it can be called any number of times. TODO!!! Per RFC2616, we may not send chunks to an HTTP/1.0 client. Raise an exception here if our user tries to do so. Chunked transfer coding is defined in RFC2616 pgh 3.6.1. The argument can be a string or a hash. The latter allows for sending chunks with extensions (someday).



200
201
202
203
# File 'lib/evma_httpserver/response.rb', line 200

def chunk text
	@chunks ||= []
	@chunks << text
end