package caqti
Module Make_unix.PoolSource
A pool implementation for the current concurrency library.
Source
val create :
?max_size:int ->
?check:('a -> (bool -> unit) -> unit) ->
?validate:('a -> bool System.future) ->
(unit -> ('a, 'e) result System.future) ->
('a -> unit System.future) ->
('a, 'e) tInternal: create alloc free is a pool of resources allocated by alloc and freed by free. This is primarily indented for implementing the connect_pool functions.
Source
val use :
?priority:float ->
('a -> ('b, 'e) result System.future) ->
('a, 'e) t ->
('b, 'e) result System.futureuse f pool calls f on a resource drawn from pool, handing back the resource to the pool when f exits.
drain pool closes all resources in pool. The pool is still usable, as new resources will be created on demand.