package ocsigenserver
Install
Dune Dependency
Authors
Maintainers
Sources
md5=cc9afaa6cad28fb2b6c803ed6cec308f
sha512=9096bc31a55f9d47f5f9b708b16d8b32cfcab99e514bce086046cf78e9731076bf2adac7e68b4291f3a0e65048e70e7c43fa2df8b80ae0eed62840db3e216b77
doc/ocsigenserver.baselib/Ocsigen_stream/index.html
Module Ocsigen_stream
Source
Streams are a means to read data block by block
A stream may be composed by several substreams. Thus a stream is either something that contains the current buffer and a function to retrieve the following data, or a finished stream with possibly another stream following.
creates a new stream
get the next step of a stream. Fails with Interrupted e
if reading the thread failed with exception e
, and with Cancelled
if the thread has been cancelled.
creates an empty step. The parameter is the following substream, if any.
Add a finalizer function. In the current version, finalizers must be called manually.
Finalize the stream. This function must be called explicitly after reading the stream, otherwise finalizers won't be called.
Cancel the stream, i.e. read the stream until the end, without decoding. Further tries to read on the stream will fail with exception Ocsigen_stream.Cancelled
Consume without cancelling. Read the stream until the end, without decoding.
possibly with the size of the stream
Creates a string from a stream. The first argument is the upper limit of the string length
stream_want s len
Returns a stream with at least len bytes in the buffer if possible
Skips data. Raises Stream_too_small (Some size)
if the stream is too small, where size
is the size of the stream.
Cut the stream at the position given by a string delimiter
returns a stream reading from a file. Do not forget to finalize the stream to close the file.
Convert a Lwt_stream.t
to an Ocsigen_stream.t
.
Convert an Ocsigen_stream.t
into a Lwt_stream.t
.