package cohttp-lwt

  1. Overview
  2. Docs

This functor keeps a cache of connecions for reuse. Connections are reused based on their remote Conduit.endp (effectively IP / port).

Parameters

module Sleep : S.Sleep

Signature

include S.Connection_cache
type t
val call : t -> S.call

Process a request. Please see call.

val create : ?ctx:Connection.Net.ctx -> ?keep:int64 -> ?retry:int -> ?parallel:int -> ?depth:int -> unit -> t

Create a new connection cache

  • parameter keep

    Number of nanoseconds to keep an idle connection around.

  • parameter retry

    Number of times a gracefully failed request is automatically retried. graceful means failed with Connection.Retry. Requests with a `Stream Body cannot be retried automatically. Such requests will fail with Connection.Retry and a new Body will need to be provided to retry.

  • parameter parallel

    maximum number of connections to establish to a single endpoint. Beware: A single hostname may resolve to multiple endpoints. In such a case connections may be created in excess to what was intended.

  • parameter depth

    maximum number of requests to queue and / or send on a single connection.

OCaml

Innovation. Community. Security.