@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
24 lines (23 loc) • 1.29 kB
TypeScript
/**
* @module SharedLock
*/
import { type ISharedLockAdapter, type ISharedLockAdapterState, type SharedLockAcquireSettings } from "../../../../shared-lock/contracts/_module.js";
import { type TimeSpan } from "../../../../time-span/implementations/_module.js";
/**
* This `NoOpSharedLockAdapter` will do nothing and is used for easily mocking {@link ISharedLockProvider | `ISharedLockProvider`} for testing.
*
* IMPORT_PATH: `"@daiso-tech/core/shared-lock/no-op-shared-lock-adapter"`
* @group Adapters
*/
export declare class NoOpSharedLockAdapter implements ISharedLockAdapter {
acquireWriter(_key: string, _lockId: string, _ttl: TimeSpan | null): Promise<boolean>;
releaseWriter(_key: string, _lockId: string): Promise<boolean>;
forceReleaseWriter(_key: string): Promise<boolean>;
refreshWriter(_key: string, _lockId: string, _ttl: TimeSpan): Promise<boolean>;
acquireReader(_settings: SharedLockAcquireSettings): Promise<boolean>;
releaseReader(_key: string, _lockId: string): Promise<boolean>;
forceReleaseAllReaders(_key: string): Promise<boolean>;
refreshReader(_key: string, _lockId: string, _ttl: TimeSpan): Promise<boolean>;
forceRelease(_key: string): Promise<boolean>;
getState(_key: string): Promise<ISharedLockAdapterState | null>;
}