IFdbDatabaseScopeProvider<TState>

Namespace: FoundationDB.Client · interface

Implements: IFdbDatabaseScopeProvider, IDisposable

Methods

GetDatabaseAndState

ValueTask<(IFdbDatabase, TState)> GetDatabaseAndState(CancellationToken ct = null)

Return both the underlying database and the scope's State, once they are ready

GetState

ValueTask<TState> GetState(IFdbReadOnlyTransaction tr)

Return the scope's State, once it is ready.

TryGetDatabaseAndState

bool TryGetDatabaseAndState(out IFdbDatabase db, out TState state)

Returns both the underlying database and the scope's State, if they are ready

  • db — Receives the database instance, if it is ready.
  • state — Receives the scope's state, if it is ready.

Returns: true if the database is ready; otherwise, false, in which case the caller should call GetDatabaseAndState and await the task.

This method is for advanced optimizations, that allows the caller to obtain the database handler in a non-async context, allowing the use of ReadOnlySpan or Span parameters.

Calling this will not attempt to auto-start the connection

TryGetState

bool TryGetState(IFdbReadOnlyTransaction tr, out TState state)

Returns the scope's State, if it is ready.

Returns: true if the state is ready; otherwise, false, in which case the caller should call GetState and await the task.

This method is for advanced optimizations, that allows the caller to obtain the database handler in a non-async context, allowing the use of ReadOnlySpan or Span parameters.

Calling this will not attempt to auto-start the connection