Files
CommunitySolidServer/lib/storage/ResourceLocker.ts
2020-05-19 12:22:25 +02:00

16 lines
482 B
TypeScript

import { Lock } from './Lock';
import { ResourceIdentifier } from '../ldp/http/ResourceIdentifier';
/**
* 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>;
}