Construct a semaphore with given capacity.
acquire resources from the semaphore.
Call this function when the semaphore is no longer needed.
Call this function before using the semaphore.
Release resources acquired via acquire.
Change the capacity of the semaphore
Try to acquire resources from the semaphore.
Report the capacity of the semaphore
Report the current amount of available resources.
Reactor aware semaphore