#include "tensorstore/progress.h"
struct [[nodiscard]] tensorstore::WriteFutures;

Handle for consuming the result of an asynchronous write operation.

This holds two futures:

  • The copy_future indicates when reading has completed, after which the source is no longer accessed.

  • The commit_future indicates when the write is guaranteed to be reflected in subsequent reads. For non-transactional writes, the commit_future completes successfully only once durability of the write is guaranteed (subject to the limitations of the underlying storage mechanism). For transactional writes, the commit_future merely indicates when the write is reflected in subsequent reads using the same transaction. Durability is not guaranteed until the transaction itself is committed successfully.

In addition, this class also provides a subset of the interface as Future, which simply forwards to the corresponding operation on commit_future.

Constructors

WriteFutures();

Constructs a null handle.

WriteFutures(Future<void> copy_futureFuture<void> commit_future);

Constructs from a copy_future and commit_future.

WriteFutures(absl::Status status);

Constructs from an absl::Status.

WriteFutures(Result<WriteFutures> result);

Unwraps a Result<WriteFutures>.

Methods

Result<void>result() const;

Returns the Future::result of the commit_future.

absl::Status status() const;

Returns the Future::status of the commit_future.

void value() const;

Returns the Future::value of the commit_future.

void Force() const;

Requests that writeback begins immediately.

Data members

Future<void> copy_future;

Becomes ready when the source is no longer needed.

Future<void> commit_future;

Becomes ready when the write has been committed (or failed).

absl::Status tensorstore::GetStatus(const WriteFuturesfuture);

Waits for future.commit_future to be ready and returns the status.