package httpaf
Module Httpaf.Client_connectionSource
type error = [ | `Malformed_response of string| `Invalid_response_body_length of Response.t| `Exn of exn
]val request :
Request.t ->
error_handler:error_handler ->
response_handler:response_handler ->
[ `write ] Body.t * tnext_read_operation t returns a value describing the next operation that the caller should conduct on behalf of the connection.
report_read_result t result reports the result of the latest read attempt to the connection. report_read_result should be called after a call to next_read_operation that returns a `Read buffer value.
`Ok nindicates that the caller successfully receivednbytes of input and wrote them into the the read buffer that the caller was provided bynext_read_operation.`Eofindicates that the input source will no longer provide any bytes to the read processor.
val next_write_operation :
t ->
[ `Write of Bigstring.t IOVec.t list | `Yield | `Close of int ]next_write_operation t returns a value describing the next operation that the caller should conduct on behalf of the connection.
report_write_result t result reports the result of the latest write attempt to the connection. report_write_result should be called after a call to next_write_operation that returns a `Write buffer value.
`Ok nindicates that the caller successfully wrotenbytes of output from the buffer that the caller was provided bynext_write_operation.`Closedindicates that the output destination will no longer accept bytes from the write processor.
yield_writer t continue registers with the connection to call continue when writing should resume. yield_writer should be called after next_write_operation returns a `Yield value.
report_exn t exn reports that an error exn has been caught and that it has been attributed to t. Calling this function will swithc t into an error state. Depending on the state t is transitioning from, it may call its error handler before terminating the connection.