AsyncSemaphoreUtils class
Semaphore: at most permits concurrent acquisitions.
Constructors
- AsyncSemaphoreUtils(int permits)
-
Creates a semaphore allowing at most
permitsconcurrent acquisitions.
Properties
Methods
-
acquire(
) → Future< void> - Waits for a permit, then acquires it (decrements available count). Completes when a permit is available. Throws Object if the underlying future completes with an error.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → void - Releases one permit (increments available count); unblocks one waiter if any.
-
run<
T> (AsyncAction< T> fn) → Future<T> -
Acquires a permit, runs
fn, then releases; ensures release on exception. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited