@squidcloud/client
    Preparing search index...

    Interface DistributedLock

    A handler for a distributed lock that can be released.

    interface DistributedLock {
        get lockId(): string;
        get resourceId(): string;
        isReleased(): boolean;
        observeRelease(): Observable<void>;
        release(): Promise<void>;
    }
    Index

    Accessors

    • get lockId(): string

      Unique lock instance ID within the system.

      Returns string

    • get resourceId(): string

      The resource identifier (mutex name) that was locked.

      Returns string

    Methods

    • Whether the lock has been released.

      Returns boolean

      True if the lock has been released.

    • Observes when the lock is released (It may be released due to a connection issue)

      Returns Observable<void>

      An observable that emits when the lock is released.

    • Releases the lock by sending a release message to the server. The release process runs asynchronously. Use observeRelease() to be notified when the release completes.

      Returns Promise<void>

      A promise that resolves when the release message is sent, or undefined for backward compatibility.