IFdbRetryable

Namespace: FoundationDB.Client · interface

Implements: IFdbReadOnlyRetryable

Transactional context that can execute, inside a retry loop, idempotent actions using read and/or write transactions.

Methods

ReadWriteAsync

Task<TResult> ReadWriteAsync<TResult>(Func<IFdbTransaction, Task<TResult>> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

Returns: Result of the last successful execution of handler.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application.

Task<TResult> ReadWriteAsync<TState, TResult>(TState state, Func<IFdbTransaction, TState, Task<TResult>> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • state — Caller-provided context or state that will be passed through to the handler
  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

Returns: Result of the last successful execution of handler.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application.

Task<TResult> ReadWriteAsync<TResult>(Action<IFdbTransaction> handler, Func<IFdbTransaction, TResult> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TResult>(Func<IFdbTransaction, Task<TResult>> handler, Action<IFdbTransaction, TResult> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

Returns: Result of the last successful execution of handler.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TResult>(Func<IFdbTransaction, Task> handler, Func<IFdbTransaction, Task<TResult>> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TResult>(Func<IFdbTransaction, Task> handler, Func<IFdbTransaction, TResult> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TIntermediate, TResult>(Func<IFdbTransaction, Task<TIntermediate>> handler, Func<IFdbTransaction, TIntermediate, TResult> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully. The intermediate result from the last invocation of handler will be passed as the seconde parameter.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TIntermediate, TResult>(Func<IFdbTransaction, Task<TIntermediate>> handler, Func<IFdbTransaction, TIntermediate, Task<TResult>> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully. The intermediate result from the last invocation of handler will be passed as the seconde parameter.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task<TResult> ReadWriteAsync<TState, TIntermediate, TResult>(TState state, Func<IFdbTransaction, TState, Task<TIntermediate>> handler, Func<IFdbTransaction, TIntermediate, Task<TResult>> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • state — Caller-provided context or state that will be passed through to the handler
  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully. The intermediate result from the last invocation of handler will be passed as the seconde parameter.
  • ct — Token used to cancel the operation

Returns: Result return by success, if it was called.

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

WriteAsync

Task WriteAsync(Action<IFdbTransaction> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application. Alternatively, you can call that supports a 'success' callback.

Task WriteAsync(Func<IFdbTransaction, Task> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application. Alternatively, you can call that supports a 'success' callback.

Task WriteAsync<TState>(TState state, Action<IFdbTransaction, TState> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • state — Caller-provided context or state that will be passed through to the handler
  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application. Alternatively, you can call that supports a 'success' callback.

Task WriteAsync<TState>(TState state, Func<IFdbTransaction, TState, Task> handler, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • state — Caller-provided context or state that will be passed through to the handler
  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda! You must wait for the Task to complete successfully before updating the global state of the application. Alternatively, you can call that supports a 'success' callback.

Task WriteAsync(Action<IFdbTransaction> handler, Action<IFdbTransaction> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task WriteAsync(Action<IFdbTransaction> handler, Func<IFdbTransaction, Task> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task WriteAsync(Func<IFdbTransaction, Task> handler, Action<IFdbTransaction> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.

Task WriteAsync(Func<IFdbTransaction, Task> handler, Func<IFdbTransaction, Task> success, CancellationToken ct)

Run an idempotent transaction block inside a writable transaction, which can be executed more than once if any retryable error occurs.

  • handler — Idempotent handler that will attempt to mutate the database, and may be retried until the transaction commits, or a non-recoverable error occurs.
  • success — Handler that will be called once the transaction commits successfully.
  • ct — Token used to cancel the operation

You do not need to commit the transaction inside the handler, it will be done automatically! Given that the can run more than once, and that there is no guarantee that the transaction commits once it returns, you MUST NOT mutate any global state (counters, cache, global dictionary) inside this lambda, and only inside the handler! Please note that there is NO guarantee that will be invoked even if the transaction commits successfully! The execution may be interrupted before the handler has time to execute.