v1.0.0
Deno module for blocking execution of a section of code to one at a time
Repository
Current version released
4 years ago
Dependencies
std
Versions
awaitable_mutex
Deno library for blocking execution of a section of code to one at a time
Usage
import Mutex from "https://deno.land/x/awaitable_mtuex/mod.ts"
const mutex = new Mutex();
const testFn = async () => {
const acquisitionId = await mutex.acquire();
// Do some data manipulation that only one process can access at a time
mutex.release(acquisitionId);
};
Testing
deno test --allow-env --allow-write --allow-net mod_test.ts