FdbFuture<TResult>

Namespace: FoundationDB.Client.Native · class

Implements: IValueTaskSource<TResult>, IDisposable

Base class for all FDBFuture wrappers

Properties

IsReady

bool IsReady { get; }

Return true if the future has completed (successfully or not)

Task

Task<TResult> Task { get; }

Real Task over this future, for consumers that need multi-consumption semantics (watches, the cached read version)

Materialized on first access, and this consumes the underlying value-task: a future whose has already been handed out must never also materialize a Task. Accessing this also pins the instance out of the pool: a holder that re-reads it after completion must keep observing THIS lifecycle.

Methods

AsValueTask

ValueTask<TResult> AsValueTask()

Exposes this future as a ValueTask that MUST be consumed exactly once

Cancel

void Cancel()

Try to abort the task (if it is still running)

Clear

void Clear()

Free memory allocated by this future after it has completed.

This method provides no benefit to most application code, and should only be called when attempting to write thread-safe custom layers.

Dispose

void Dispose()

GetAwaiter

TaskAwaiter<TResult> GetAwaiter()

Make the Future awaitable

TrySetCanceled

bool TrySetCanceled()

TrySetException

bool TrySetException(Exception error)

TrySetResult

bool TrySetResult(TResult result)