-
#include "tensorstore/progress.h" - struct [[nodiscard]] tensorstore::WriteFutures;
Handle for consuming the result of an asynchronous write operation.
This holds two futures:
The
copy_futureindicates when reading has completed, after which the source is no longer accessed.The
commit_futureindicates when the write is guaranteed to be reflected in subsequent reads. For non-transactional writes, thecommit_futurecompletes successfully only once durability of the write is guaranteed (subject to the limitations of the underlying storage mechanism). For transactional writes, thecommit_futuremerely 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 oncommit_future.Constructors¶
- WriteFutures();
Constructs a null handle.
- WriteFutures(Future<void> copy_future, Future<void> commit_future);
Constructs from a
copy_futureandcommit_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::resultof thecommit_future.
- absl::Status status() const;
Returns the
Future::statusof thecommit_future.
- void value() const;
Returns the
Future::valueof thecommit_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).
Related Functions¶
- absl::Status tensorstore::GetStatus(const WriteFutures& future);
Waits for
future.commit_futureto be ready and returns the status.