Options
All
  • Public
  • Public/Protected
  • All
Menu

Store that for every call acquires a lock before executing it on the requested resource, and releases it afterwards.

Hierarchy

  • LockingResourceStore

Implements

Index

Constructors

constructor

Properties

Private Readonly locks

Protected Readonly logger

logger: Logger = ...

Private Readonly source

Methods

addResource

Protected createExpiringReadable

Protected createExpiringRepresentation

deleteResource

getRepresentation

Protected lockedRepresentationRun

Protected lockedRun

  • Acquires a lock for the identifier and releases it when the function is executed.

    Type parameters

    • T

    Parameters

    • identifier: ResourceIdentifier

      Identifier that should be locked.

    • func: () => Promise<T>

      Function to be executed.

        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<T>

modifyResource

setRepresentation