/// <summary>EXPERIMENTAL</summary> public Task ReadAsync([InstantHandle] Func <IFdbReadOnlyTransaction, Task> asyncHandler, [InstantHandle] Action <IFdbReadOnlyTransaction> onDone, CancellationToken cancellationToken) { return(FdbOperationContext.RunReadAsync(this, asyncHandler, onDone, cancellationToken)); }
//NOTE: other bindings use different names or concept for transactionals, and some also support ReadOnly vs ReadWrite transaction // - Python uses the @transactional decorator with first arg called db_or_trans // - JAVA uses db.run() and db.runAsync(), but does not have a method for read-only transactions // - Ruby uses db.transact do |tr| // - Go uses db.Transact(...) and db.ReadTransact(...) // - NodeJS uses fdb.doTransaction(function(...) { ... }) // Conventions: // - ReadAsync() => read-only // - WriteAsync() => write-only // - ReadWriteAsync() => read/write #region IFdbReadOnlyTransactional methods... /// <summary>Runs a transactional lambda function against this database, inside a read-only transaction context, with retry logic.</summary> /// <param name="asyncHandler">Asynchronous lambda function that is passed a new read-only transaction on each retry.</param> /// <param name="ct">Optional cancellation token that will be passed to the transaction context, and that can also be used to abort the retry loop.</param> public Task ReadAsync([InstantHandle] Func <IFdbReadOnlyTransaction, Task> asyncHandler, CancellationToken ct) { return(FdbOperationContext.RunReadAsync(this, asyncHandler, null, ct)); }