-
#include "tensorstore/util/future.h" - class [[nodiscard]] tensorstore::AnyFuture;
Generic consumer interface to a one-time channel.
Constructors¶
Methods¶
- void IgnoreFuture() const;
Ignores the future. This method signals intent to ignore the result to suppress compiler warnings from [[nodiscard]].
- void reset();
Resets this Future to be null.
- bool ready() const;
Returns
trueif the result is ready.
- bool WaitFor(absl::Duration duration) const;
Waits for up to the specified duration for the result to be ready.
- bool WaitUntil(absl::Time deadline) const;
Waits until the specified time for the result to be ready.
- void Force() const;
Calls any
Forcecallbacks registered on the associatedPromise, if they have not already been called.
- const absl::Status& status() const&;
Calls
Force(), waits for the result to be ready, and returns a const reference to the containedabsl::Status. If the underlyingFuturecontains a value, then this function returnsabsl::OkStatus().
-
FutureCallbackRegistration
UntypedExecuteWhenReady(Callback&& callback); Executes
callbackwith the signaturevoid(AnyFuture)when this becomesready.
Related Functions¶
-
bool tensorstore::HaveSameSharedState(const AnyFuture& a,
const AnyFuture& b); Returns
trueif both futures refer to the same shared state, or are both null.
- absl::Status tensorstore::GetStatus(const AnyFuture& future);
Waits for the future to be ready and returns the status.