-
#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() noexcept;
Resets this Future to be null.
- bool ready() const noexcept;
Returns
true
if the result is ready.
- bool WaitFor(absl::Duration duration) const noexcept;
Waits for up to the specified duration for the result to be ready.
- bool WaitUntil(absl::Time deadline) const noexcept;
Waits until the specified time for the result to be ready.
- void Force() const noexcept;
Calls any
Force
callbacks registered on the associatedPromise
, if they have not already been called.
- const absl::Status& status() const& noexcept;
Calls
Force()
, waits for the result to be ready, and returns OkStatus (when a value is present) or a copy of result.status().
-
FutureCallbackRegistration
UntypedExecuteWhenReady(Callback&& callback); Executes
callback
with the signaturevoid(AnyFuture)
when this becomesready
.
Related Functions¶
-
bool tensorstore::HaveSameSharedState(const AnyFuture& a,
const AnyFuture& b); Returns
true
if 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.