Module Fut.Sem
Semaphores for limiting resource usage.
TODO doc.
Semaphores
- type 'a future- = 'a t
- type token
- The type for tokens. 
- val create : capacity:int -> t
- create capacityis a semaphore with a token capacity of- capacity.
- val capacity : t -> int
- capacity sis- s's token capacity.
- val available : t -> int
- available sis- s's number of available tokens.
- val take : t -> token future
- take sis a future that determines as follows:- If at call time available s > 0, decrementsavailable sand determines a token immediately.
- Otherwise determines when available sbecomes> 0and all previous futures resulting fromtake shave been set (i.e. you are served in FIFO order).
 
- If at call time