package docker-api

  1. Overview
  2. Docs

Module Docker.StreamSource

A stream returned by some Docker functions.

Sourcetype t
Sourcetype kind =
  1. | Stdout
  2. | Stderr
Sourceexception Timeout
Sourceval out : t -> 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.

Sourceval 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.

Sourceval 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.

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

Read all the available data on the stream.

Sourceval close : t -> unit

Close the stream.

OCaml

Innovation. Community. Security.