@temporalio/common
Version:
Common library for code that's used across the Client, Worker, and/or Workflow
14 lines (13 loc) • 338 B
TypeScript
/**
* A simple counting semaphore. `release` hands a permit directly to the longest-waiting acquirer if
* any, otherwise returns it to the pool.
*
* @internal
*/
export declare class Semaphore {
private permits;
private readonly waiters;
constructor(permits: number);
acquire(): Promise<void>;
release(): void;
}