package paf
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=d2ad3b819a735320e85a50389bf3fe1064afbd528067b470564a4ece2ab31b63
sha512=e6bf4640a1411ab15fcec1fda9c494bfa895bd1d5c2f40542a9680252dd2cabf2f3da7f17849489e5ddfef2c003b35a9945a2f8aae432d3d1608745f02767612
doc/paf/Paf/module-type-RUNTIME/index.html
Module type Paf.RUNTIME
Source
next_read_connection t
returns a value describing the next operation that the caller should conduit on behalf of the connection.
read t bigstring ~off ~len
reads bytes of input from the provided range of bigstring
an returns the number of bytes consumed by the connection. read
should be called after next_read_operation
returns a `Read
value an additional input is available for the connection to consume.
read_eof t bigstring ~off ~len
reads bytes of input from the provided range of bigstring
and returns the number of bytes consumed by the connection. read_eof
should be called after next_read_operation
returns a `Read
and an EOF has been received from the communication channel. The connection will attempt to consume any buffered input and then shutdown the HTTP parser for the connection.
yield_reader t continue
registers with the connection to call continue
when reading should resume. yield_reader
should be called after next_read_operation
returns a `Yield
value.
val next_write_operation :
t ->
[ `Write of Bigstringaf.t Faraday.iovec list
| `Yield
| `Close of int
| `Upgrade ]
next_write_operation t
returns a value describing the next operation that the caller should conduct on behalf 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 n
indicates that the caller successfully wroten
bytes of output from the buffer that the caller was provided bynext_write_operation
that returns a`Write buffer
value.`Closed
indicates 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 switch t
into an error state. Depending on the tate t
is transitioning from, it may call its error handler before terminating the connection.
is_closed t
is true
if both the read and write processors have been shutdown. When this is the case next_read_operation
will return `Close _
and next_write_operation
will return a `Write _
until all buffered output has been flushed, at which point it will return `Close
.