commit method

Future<void> commit()

Commits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.

Implementation

Future<void> commit() => _cache._lock.synchronized(() async {
      if (_done) throw StateError('editor was done');
      if (_entry.currentEditor == this) {
        try {
          await _cache._completeEdit(this, true);
        } finally {
          _done = true;
        }
      } else {
        _done = true;
      }
    });