package
Some concurrency semantics around entering scopes
npm install scope-lockGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 1 packages.
14.0 kB
Includes dependencies.
Some concurrency semantics around entering scopes
npm install scope-lockconst ScopeLock = require('scope-lock')
// normal lock runs all entries in the lock list
const l = new ScopeLock()
await l.lock()
// ... do your thing
l.unlock()
// debounced lock runs first and last entry in the lock list
const d = new ScopeLock({ debounce: true }) // debounced lock
if (await d.lock()) {
// if we get lock do our thing
}
// wait for all current work to drain
await d.flush()Apache-2.0