UNPKG

lavva.exalushome

Version:

Library implementing communication and abstraction layers for ExalusHome system

22 lines (21 loc) 574 B
type Lock = { Release: () => void; }; export declare class AsyncSemaphore { initialCount: number; private _running; private _waiting; constructor(initialCount: number); private Take; /** * Acquire a lock on the target resource. * @returns a function to release the lock, it is critical that this function is called when the task is finished with the resource. */ AcquireAsync: () => Promise<Lock>; private Release; /** * Purge all waiting tasks from the Semaphore instance */ Purge: () => void; } export {};