igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
14 lines (13 loc) • 446 B
TypeScript
/**
* Wrapper for an `async-mutex` {@link Semaphore} that can have its total increased if a weight
* exceeds the maximum.
*/
export default class ElasticSemaphore {
private readonly semaphoreValue;
private readonly semaphore;
constructor(value: number);
/**
* Run some {@link callback} with a required {@link weight}.
*/
runExclusive<T>(callback: (value: number) => Promise<T> | T, weight: number): Promise<T>;
}