Options
All
  • Public
  • Public/Protected
  • All
Menu

A resource locker making use of the async-lock library. Note that all locks are kept in memory until they are unlocked which could potentially result in a memory leak if locks are never unlocked, so make sure this is covered with expiring locks for example, and/or proper finally handles.

Hierarchy

  • SingleThreadedResourceLocker

Implements

Index

Constructors

constructor

Properties

Private Readonly locker

locker: AsyncLock

Protected Readonly logger

logger: Logger = ...

Private Readonly unlockCallbacks

unlockCallbacks: Record<string, () => void>

Methods

acquire

Private getLockCount

  • getLockCount(): number

release