write method
Writes the value of the object.
Parameters:
callback: The callback function that performs the writing.
Implementation
Future<void> write(FutureOr<T> Function(T value) callback) async {
await _lock.acquire();
try {
_writeCount++;
_value = await callback(_value);
} finally {
_writeCount--;
await _lock.release();
}
}