Class SingleThreadedResourceLocker
Hierarchy
SingleThreadedResourceLocker
Properties
Private Readonly locks
locks: AsyncLock
Protected Readonly logger
Methods
Private withLock
withLock<T>( identifier: ResourceIdentifier , whileLocked: ( ) => T | Promise < T > ) : Promise < T >
Type parameters
Parameters
whileLocked: ( ) => T | Promise < T >
Returns Promise < T >
withReadLock
withReadLock<T>( identifier: ResourceIdentifier , whileLocked: ( ) => T | Promise < T > ) : Promise < T >
Type parameters
Parameters
whileLocked: ( ) => T | Promise < T >
Returns Promise < T >
withWriteLock
withWriteLock<T>( identifier: ResourceIdentifier , whileLocked: ( ) => T | Promise < T > ) : Promise < T >
Type parameters
Parameters
whileLocked: ( ) => T | Promise < T >
Returns Promise < T >
Legend
Variable
Function
Function with type parameter
Type alias
Type alias with type parameter
Class
Class with type parameter
Constructor
Interface
Interface with type parameter
A resource locker making use of the
async-lock
library. Read and write locks use the same locks so no preference is given to any operations. This should be changed at some point though, see #542.