clearBuffer method

void clearBuffer()

Resets the pending count and unblocks any producer waiting on backpressure. Does not remove already-added events from the stream.

Implementation

void clearBuffer() {
  _pendingCount = 0;
  if (_resumeCompleter != null) {
    _resumeCompleter!.complete();
    _resumeCompleter = null;
  }
}