-
#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, thecommit_future
completes successfully only once durability of the write is guaranteed (subject to the limitations of the underlying storage mechanism). For transactional writes, thecommit_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 oncommit_future
.Constructors¶
- WriteFutures();
Constructs a null handle.
- WriteFutures(Future<void> copy_future, Future<void> commit_future);
Constructs from a
copy_future
andcommit_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 thecommit_future
.
- absl::Status status() const;
Returns the
Future::status
of thecommit_future
.
- void value() const;
Returns the
Future::value
of 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_future
to be ready and returns the status.