Skip to main content
Module

x/async/semaphore.ts>BoundedSemaphore

🦕 Asynchronous primitive modules loosely port from Python's asyncio for Deno.
Go to Latest
class BoundedSemaphore
extends Semaphore
import { BoundedSemaphore } from "https://deno.land/x/async@v1.1.2/semaphore.ts";

A bounded semaphore object. Not thread-safe.

Bounded Semaphore is a version of Semaphore that throws an Error in release() if it increases the internal counte above the initial value.

Constructors

new
BoundedSemaphore(value?)

Methods

release(): void

Release a semaphore, incrementing the internal counter by one. Can wak up a task waiting to acquire the semaphore.