@zingle/mutex

    0.0.2 • Public • Published

    The mutex function creates synchronization primitives for values or objects.

    Usage

    const mutex = require("@zingle/mutex");
    
    function critical(resource) {
        if (let release = mutex(resource)) {
            // ...do critical things...
            release();
        } else {
            throw new Error("could not acquire lock");
        }
    }

    Install

    npm i @zingle/mutex

    DownloadsWeekly Downloads

    3

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4.08 kB

    Total Files

    6

    Last publish

    Collaborators

    • njovin
    • oleksandr.vladymyrov
    • rremer
    • lmedrano
    • llongo-medallia