Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LockManager

Hierarchy

  • LockManager

Index

Properties

acquiring

acquiring: CacheLock[] = []

An array of locks that the manager is currently trying to acquire

held

held: CacheLock[] = []

An array of locks that the manager currently holds.

This list is drained as locks are released.

nextLockId

nextLockId: number = 1

waiting

waiting: CacheLock[] = []

An array of locks that the manager does not hold.

When acquiring a cache lock, the lock may be added to this array if:

  • the new lock is a write lock and there are currently held locks
  • the new lock is a read lock and there is a write lock being held

This array is drained when a lock releases, using the following algorithm:

  • If any write locks exist, then the first write lock in the array will be acquired and moved to the held array.
  • If no write locks remain, the rest of the locks are acquired all at once and moved to the held array.

Accessors

hasReadLock

  • get hasReadLock(): boolean

hasWriteLock

  • get hasWriteLock(): boolean

Methods

acquireLock

  • acquireLock(isWrite: boolean): Promise<CacheLock>

findLock

  • findLock(lockid: number | undefined): undefined | CacheLock

Protected onReleaseLock

  • onReleaseLock(lock: CacheLock): Promise<void>

Generated using TypeDoc