Semaphore class
A semaphore prevents asynchronous code from being executed simultaneously.
Constructors
Properties
Methods
-
debounce<
TResult> (FutureOr< TResult> job(), {Duration delay = const Duration(milliseconds: 250)}) → Future<TResult?> -
Function
job
is only executed when no other job is scheduled within thedelay
period. -
lock(
) → Future - Locks the semaphore. The Future completes as soon as the semaphore is released and can be locked again.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → void - Releases the current lock on the semaphore.
-
runLocked<
TResult> (FutureOr< TResult> job()) → Future<TResult> -
Function
job
is executed immediately if the semaphore is not locked, as soon as the last scheduled job finishes otherwise. -
throttle<
TResult> (FutureOr< TResult> job()) → Future<TResult?> -
Function
job
is executed only if the semaphore is not locked. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited