notifyN method

void notifyN(
  1. int n
)

Implementation

void notifyN(int n) {
  if (_closed || n <= 0) return;
  _epoch += n;
  while (n-- > 0 && _waiters.isNotEmpty) {
    final c = _waiters.removeAt(0);
    if (!c.isCompleted) c.complete();
  }
  if (n > 0) _permits += n;
}