getEventCount method

Future<int> getEventCount()

Get total event count across SQLite + memory.

Implementation

Future<int> getEventCount() async {
  return await _lock.synchronized(() async {
    int count = 0;
    if (_dbAvailable) {
      count += await _sqliteStorage.getEventCount();
      _syncStorageState();
      count -= _pendingSqliteDeleteIds.length;
      if (count < 0) {
        count = 0;
      }
    }
    count += _memoryQueue.length;
    return count;
  });
}