TS-Scribe - v1.2.0
    Preparing search index...

    Class SemaphoreLock

    A lock returned by Semaphore.acquire. Call SemaphoreLock.release to free the slot and allow the next waiting operation to proceed.

    const semaphore = new Semaphore(3);
    const lock = await semaphore.acquire();
    try {
    // ... do concurrent-limited work ...
    } finally {
    lock.release(); // always release, even on error
    }
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Releases the lock and allows the next waiting operation to proceed. Subsequent calls are no-ops; the lock can only be released once.

      Returns void