redlock-universal
    Preparing search index...

    Class LeanSimpleLock

    Lean SimpleLock - Optimized for memory efficiency

    Memory optimizations:

    • No circuit breaker by default (saves ~100KB)
    • No health checks by default (saves ~50KB)
    • Pre-allocated error objects (saves stack trace overhead)
    • Minimal property storage with short names
    • No closures or callbacks
    • Inline value generation

    Implements

    Index

    Constructors

    Methods

    • Extend the TTL of an existing lock

      Parameters

      • handle: LockHandle

        Lock handle from acquire()

      • newTtl: number

      Returns Promise<boolean>

      Promise resolving to true if extended, false if lock expired

    • Check if a lock is currently held

      Parameters

      • key: string

        Lock key to check

      Returns Promise<boolean>

      Promise resolving to true if locked, false otherwise

    • Execute a routine with automatic lock management and extension Auto-extends when remaining TTL < 20% (extends at ~80% consumed) Provides AbortSignal when extension fails

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

      Result of the routine