1.0.0
A simple lock to synchronize async code
Repository
Current version released
5 years ago
Versions
Deno-async-lock
A simple lock to synchronize async code.
Example
// Creats a new lock
const lock = new Lock();
// Use the `run` method, also works with an async method
await lock.run(() => { console.log("hello"); });
// Or use the lock manually
const release = await lock.aquire();
console.log("world");
release();