@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.
25 lines (24 loc) • 1.63 kB
TypeScript
/**
* @module SharedLock
*/
import { type IReadableContext } from "../../../../execution-context/contracts/_module.js";
import { type ISharedLockAdapter, type ISharedLockAdapterState, type SharedLockAcquireSettings } from "../../../../shared-lock/contracts/_module.js";
import { type TimeSpan } from "../../../../time-span/implementations/_module.js";
/**
* The `NoOpSharedLockAdapter` will do nothing and is used for easily mocking {@link ISharedLockFactory | `ISharedLockFactory`} for testing.
*
* IMPORT_PATH: `"@daiso-tech/core/shared-lock/no-op-shared-lock-adapter"`
* @group Adapters
*/
export declare class NoOpSharedLockAdapter implements ISharedLockAdapter {
acquireWriter(_context: IReadableContext, _key: string, _lockId: string, _ttl: TimeSpan | null): Promise<boolean>;
releaseWriter(_context: IReadableContext, _key: string, _lockId: string): Promise<boolean>;
forceReleaseWriter(_context: IReadableContext, _key: string): Promise<boolean>;
refreshWriter(_context: IReadableContext, _key: string, _lockId: string, _ttl: TimeSpan): Promise<boolean>;
acquireReader(_settings: SharedLockAcquireSettings): Promise<boolean>;
releaseReader(_context: IReadableContext, _key: string, _lockId: string): Promise<boolean>;
forceReleaseAllReaders(_context: IReadableContext, _key: string): Promise<boolean>;
refreshReader(_context: IReadableContext, _key: string, _lockId: string, _ttl: TimeSpan): Promise<boolean>;
forceRelease(_context: IReadableContext, _key: string): Promise<boolean>;
getState(_context: IReadableContext, _key: string): Promise<ISharedLockAdapterState | null>;
}