#include "tensorstore/util/future.h"
template <class Callback>
FutureCallbackRegistration
tensorstore::Future<T>::ExecuteWhenReady(Callback&callback) &&;
template <class Callback>
FutureCallbackRegistration
tensorstore::Future<T>::ExecuteWhenReady(Callback&callback) const&;

Registers a callback to invoke when ready() becomes true.

Dchecks:

!null().

Parameters:
Callback &&callback

A function object to be invoked with a ReadyFuture<T> referring to the same shared state as *this. The return value of the callback is ignored.

Returns:

A handle that may be used to unregister the callback.

Warning

If this Future corresponds to a deferred operation, it may be necessary to call Force() directly or indirectly in order to ensure the registered callback is ever actually invoked.