The standard semaphore concept, with an async API.
include sig ... endval sexp_of_t : t ‑> Base.Sexp.tval create : int ‑> tCreate a simple counting semaphore, create initial_value is the inital value of the
semaphore. Callers to decr will wait until the value is positive.
val incr : t ‑> unitIncrement the semaphore and if there are jobs sleeping on decr wakeup one of them.
val decr : t ‑> unit Async.Deferred.tDecrement the sempahore. This blocks if resulting the semaphore value is negative.
val resource : t ‑> (unit, Core.Nothing.t) Resource.tInterface to semaphore where the users can only return the tokens they took from semaphore, not add more tokens