mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
16 lines
502 B
TypeScript
16 lines
502 B
TypeScript
import type { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier';
|
|
import type { Lock } from './Lock';
|
|
|
|
/**
|
|
* Allows the locking of resources which is needed for non-atomic {@link ResourceStore}s.
|
|
*/
|
|
export interface ResourceLocker {
|
|
/**
|
|
* Lock the given resource.
|
|
* @param identifier - Identifier of the resource that needs to be locked.
|
|
*
|
|
* @returns A promise containing the lock on the resource.
|
|
*/
|
|
acquire: (identifier: ResourceIdentifier) => Promise<Lock>;
|
|
}
|