Skip to main content

Home > flowp > Semaphore > tryAcquire

Semaphore.tryAcquire() method

Try to synchronosly acquire if there's remaining permits

Signature:

tryAcquire(): () => void;

Returns:

() => void

a function to release the semaphore

Exceptions

Error if semaphore is drained