Callback method when data is available to read

Property definitions

libevent $ Connection :: read_callback
	# Callback method when data is available to read
	fun read_callback(content: String)
	do
		if close_requested then close
	end
lib/libevent/libevent.nit:202,2--206,4

nitcorn $ HTTPConnection :: read_callback
	# FIXME will not work if the header/body delimiter falls between two watermarks windows.
	redef fun read_callback(str)
	do
		# is this the start of a request?
		if not in_request then parse_start

		var body: String
		# parsing header
		if in_header then
			body = parse_header(str)
		else
			body = str
		end

		# parsing body
		if in_body then parse_body(body)
	end
lib/nitcorn/http_request_buffer.nit:34,2--50,4

libevent $ EchoConnection :: read_callback
	redef fun read_callback(content)
	do
		print "Received: {content}"
		write content
	end
lib/libevent/libevent_example.nit:34,2--38,4

libevent $ TestConnection :: read_callback
	redef fun read_callback(content)
	do
		0.2.sleep # Forcing the server output after the client output
		printn "[Server] Read: {content}"
	end
lib/libevent/libevent_test.nit:50,2--54,4