sync-primitives
Installation
npm install sync-primitives
API
Semaphore
constructor
-
number
[value=1]
acquire
-
Object
[opts]-
boolean
[blocking=true] -
boolean
[timeout=-1]
-
return: Promise.<boolean>
release
withLock
-
function
fn -
Object
[opts]-
boolean
[blocking=true] -
boolean
[timeout=-1]
-
return: Promise.<[boolean, *]>
Condition
...
Event
constructor
isSet
return: boolean
set
clear
wait
-
number
timeout
return: Promise.<boolean>
Barrier
...
License
Code released under the MIT license.