@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.
20 lines (19 loc) • 1.05 kB
TypeScript
/**
* @module Lock
*/
import { type IReadableContext } from "../../../../execution-context/contracts/_module.js";
import { type ILockAdapter, type ILockAdapterState } from "../../../../lock/contracts/_module.js";
import { type TimeSpan } from "../../../../time-span/implementations/_module.js";
/**
* The `NoOpLockAdapter` will do nothing and is used for easily mocking {@link ILockFactory | `ILockFactory`} for testing.
*
* IMPORT_PATH: `"@daiso-tech/core/lock/no-op-lock-adapter"`
* @group Adapters
*/
export declare class NoOpLockAdapter implements ILockAdapter {
acquire(_context: IReadableContext, _key: string, _lockId: string, _ttl: TimeSpan | null): Promise<boolean>;
release(_context: IReadableContext, _key: string, _lockId: string): Promise<boolean>;
forceRelease(_context: IReadableContext, _key: string): Promise<boolean>;
refresh(_context: IReadableContext, _key: string, _lockId: string, _ttl: TimeSpan): Promise<boolean>;
getState(_context: IReadableContext, _key: string): Promise<ILockAdapterState | null>;
}