Skip to content

Commit

Permalink
Improve use and wait_queue_length docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbypriam authored and aantron committed Apr 15, 2018
1 parent 559cadf commit b17692c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/lwt_pool.mli
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let create_user name =
)
]}
Note that this is {e not} intended to keep a pool of {e system} threads.
Note that this is {e not} intended to keep a pool of system threads.
If you want to have such pool, consider using {!Lwt_preemptive}. *)

type 'a t
Expand Down Expand Up @@ -89,9 +89,12 @@ val create :
of. *)

val use : 'a t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
(** [use p f] takes one free element of the pool [p] and gives it to
(** [use p f] requests one free element of the pool [p] and gives it to
the function [f]. The element is put back into the pool after the
promise created by [f] completes. *)
promise created by [f] completes.
In the case that [p] is exhausted and the maximum number of elements
is reached, [use] will wait until one becomes free. *)

val clear : 'a t -> unit Lwt.t
(** [clear p] will clear all elements in [p], calling the [dispose] function
Expand All @@ -105,5 +108,5 @@ val clear : 'a t -> unit Lwt.t
Disposals are performed sequentially in an undefined order. *)

val wait_queue_length : _ t -> int
(** [wait_queue_length p] returns the number of threads currently
(** [wait_queue_length p] returns the number of {!use} requests currently
waiting for an element of the pool [p] to become available. *)

0 comments on commit b17692c

Please sign in to comment.