Interface ResourceLocker

An interface for classes that only have 1 way to lock interfaces. In general this should only be used by components implementing the ReadWriteLocker interface. Other components that require locking of resources should use that interface.

interface ResourceLocker {
    acquire: ((identifier: ResourceIdentifier) => Promise<void>);
    release: ((identifier: ResourceIdentifier) => Promise<void>);
}

Implemented by

Properties

Properties

acquire: ((identifier: ResourceIdentifier) => Promise<void>)

Acquires a lock on the requested identifier. The promise will resolve when the lock has been acquired.

Type declaration

    • (identifier): Promise<void>
    • Parameters

      Returns Promise<void>

release: ((identifier: ResourceIdentifier) => Promise<void>)

Releases a lock on the requested identifier. The promise will resolve when the lock has been released. If there is no lock on the resource, an error should be thrown.

Type declaration

    • (identifier): Promise<void>
    • Parameters

      Returns Promise<void>