Skip to main content
Module

x/grm/deps.ts>Semaphore

MTProto API Client for Deno 🦕
Go to Latest
class Semaphore
implements SemaphoreInterface
import { Semaphore } from "https://deno.land/x/grm@0.5.1/deps.ts";

Constructors

new
Semaphore(_maxConcurrency: number, _cancelError?: Error)

Properties

private
_cancelError
private
_currentReleaser
private
_dispatch
private
_maxConcurrency
private
_queue
private
_resolveWaiters
private
_value
private
_waiters

Methods

acquire(): Promise<[number, SemaphoreInterface.Releaser]>
cancel(): void
isLocked(): boolean
deprecated
release(): void
runExclusive<T>(callback: SemaphoreInterface.Worker<T>): Promise<T>
waitForUnlock(): Promise<void>