flush method

  1. @override
Future flush()
override

Calls the onFlush callback with the events in the queue

Implementation

@override
flush() async {
  if (_state != null) {
    await _state!.ready;
    final events = await _state!.state;
    try {
      if (!_isPendingUpload) {
        _isPendingUpload = true;
        await _onFlush(events);
        _state!.flush();
      }
    } finally {
      _isPendingUpload = false;
    }
  }
}