abortableReadLock<T> method

  1. @override
Future<T> abortableReadLock<T>(
  1. Future<T> callback(
    1. SqliteReadContext tx
    ), {
  2. Future<void>? abortTrigger,
  3. String? debugContext,
})
override

Takes a read lock, without starting a transaction.

The lock only applies to a single SqliteConnection, and multiple connections may hold read locks at the same time.

If abortTrigger is set and completes before the database was able to obtain a read lock, an AbortException will be thrown.

Implementation

@override
Future<T> abortableReadLock<T>(
  Future<T> Function(SqliteReadContext tx) callback, {
  Future<void>? abortTrigger,
  String? debugContext,
}) async {
  await isInitialized;
  return database.abortableReadLock(
    callback,
    abortTrigger: abortTrigger,
    debugContext: debugContext,
  );
}