package caqti-lwt

  1. Overview
  2. Docs
Lwt support for Caqti

Install

dune-project
 Dependency

Authors

Maintainers

Sources

caqti-v3.0.0.tbz
sha256=3ceea06ba0e8e8bcab0386b5817b68cb30fce457eaa25ada0182891d66f6a0b9
sha512=e01f546a45b04cafd5fa262e9228e5a1aabd5e0942059c073a4181c928450baf3d990cc59ffb1a33dff445b46a0e218224a23dca96e8d24cdd0ab793d08e4538

doc/caqti-lwt.unix/Caqti_lwt_unix/Pool/index.html

Module Caqti_lwt_unix.PoolSource

Sourcetype ('a, +'e) t
Sourceval size : ('a, 'e) t -> int

size pool is the current number of open resources in pool.

Sourceval use : ?priority:float -> ('a -> ('b, 'e) result Lwt.t) -> ('a, 'e) t -> ('b, 'e) result Lwt.t

use f pool calls f on a resource drawn from pool, handing back the resource to the pool when f exits. The result returned by f is not used by Caqti, but allows flattening errors into a single polymorphic variant type.

  • parameter priority

    Requests for the resource are handled in decreasing order of priority. The default priority is 0.0.

Sourceval drain : ('a, 'e) t -> unit Lwt.t

drain pool closes all resources in pool once they become idle. The pool is still usable, as new resources will be created on demand. Resources are not closed while they are in use.