#include "tensorstore/util/future.h"
template <typename Callback,
         
 typename PromiseValue,
         
 typename... Futures>
FutureCallbackRegistration
tensorstore::LinkValue(Callback&callback,
                       
Promise<PromiseValue> promise,
                       
Futures&&... future);

Creates a “link”, which ties a promise to one or more future objects and a callback.

Same as Link, except that the callback is called only if the future objects become ready with a non-error result. The first error result encountered among the future objects will be automatically propagated to the promise.

Parameters:
Callback &&callback

The function to be invoked.

Promise<PromiseValue> promise

The promise to be linked.

Futures&&... future

The futures to be linked.

Returns:

A FutureCallbackRegistration handle that can be used to remove this link.