Module Docker.Stream

A stream returned by some Docker functions.

type t
type kind =
| Stdout
| Stderr
exception Timeout
val out : t -> Stdlib.out_channel

out stream may be used to send data to the process running in the container. Closing this channel is equivalent to calling close.

val shutdown : t -> unit

shutdown stream transmit an end-of-file condition to the server reading on the other side of the connection meaning that you have finished sending data. You can still read data from the string. You must still close the string with close.

val read : ?timeout:float -> t -> kind * string

read stream reads the next payload from the stream. The byte sequence will be empty if there is nothing to read at the time of the call (in particular, if everything has been read).

  • raises Timeout

    if the payload could not be read within the allowed timeout. A negative timeout (the default) means unbounded wait.

val read_all : t -> (kind * string) list

Read all the available data on the stream.

val close : t -> unit

Close the stream.