AsyncReaderWriterLock Class
Package: @esfx/async-readerwriterlock
Coordinates readers and writers for a resource.
Declaration
export declare class AsyncReaderWriterLock
Methods
createReader()
Creates a AsyncReaderWriterLockReader
that can be used to take and release "read" locks on a resource.
Declaration
createReader(): AsyncReaderWriterLockReader;
Returns
createUpgradeableReader()
Creates a AsyncReaderWriterLockUpgradeableReader
that can be used to take and release "read" locks on a resource
and can be later upgraded to take and release "write" locks.
Declaration
createUpgradeableReader(): AsyncReaderWriterLockUpgradeableReader;
Returns
createWriter()
Creates a AsyncReaderWriterLockWriter
that can be used to take and release "write" locks on a resource.
Declaration
createWriter(): AsyncReaderWriterLockWriter;
Returns
read(cancelable)
Asynchronously waits for and takes a read lock on a resource.
Declaration
read(cancelable?: Cancelable): Promise<AsyncReaderWriterLockReader>;
Parameters
Returns
upgradeableRead(cancelable)
Asynchronously waits for and takes a read lock on a resource that can later be upgraded to a write lock.
Declaration
upgradeableRead(cancelable?: Cancelable): Promise<AsyncReaderWriterLockUpgradeableReader>;
Parameters
Returns
write(cancelable)
Asynchronously waits for and takes a write lock on a resource.
Declaration
write(cancelable?: Cancelable): Promise<AsyncReaderWriterLockWriter>;