#include "tensorstore/util/future.h"
template <typename T>
class [[nodiscard]] tensorstore::PromiseFuturePair;

Pairs a Promise with a Future.

This is the primary interface intended to be used by producers.

Template Parameters:
typename T

The contained value type. The actual result type of the Promise and Future is Result<T>.

Types

using PromiseType = Promise<T>;

Promise type.

using FutureType = Future<T>;

Future type.

Data members

PromiseType promise;

Promise object.

FutureType future;

Future object.

Methods

static PromiseFuturePair Make(ResultInit&&... result_init);

Makes a new Promise/Future pair.

static PromiseFuturePair
Link(Callback&callbackFutures&&... future);
static PromiseFuturePair Link(ResultInit&result_init,
                              
Callback&callback,
                              
Futures&&... future);

Creates a new PromiseFuturePair and links the newly created promise with the specified future objects as if by calling tensorstore::Link.

static PromiseFuturePair
LinkValue(Callback&callbackFutures&&... future);
static PromiseFuturePair LinkValue(ResultInit&result_init,
                                   
Callback&callback,
                                   
Futures&&... future);

Same as Link, except that the behavior matches tensorstore::LinkValue instead of tensorstore::Link.

static PromiseFuturePair
LinkError(ResultInit&result_initFutures&&... future);

Creates a new PromiseFuturePair with the Future result initialized using result_init. Links the specified future objects to the newly created promise as if by calling tensorstore::LinkError.