CommunitySolidServer/src/storage/ResourceLocker.ts
2020-09-17 11:55:49 +02:00

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>;
}