Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/async/mod.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.5/mod.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.