MCPcopy Create free account
hub / github.com/apache/mesos / thenf

Function thenf

3rdparty/libprocess/include/process/future.hpp:1468–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1466// Future since the compiler can't properly infer otherwise.
1467template <typename T, typename X>
1468void thenf(lambda::CallableOnce<Future<X>(const T&)>&& f,
1469 std::unique_ptr<Promise<X>> promise,
1470 const Future<T>& future)
1471{
1472 if (future.isReady()) {
1473 if (future.hasDiscard()) {
1474 promise->discard();
1475 } else {
1476 promise->associate(std::move(f)(future.get()));
1477 }
1478 } else if (future.isFailed()) {
1479 promise->fail(future.failure());
1480 } else if (future.isDiscarded()) {
1481 promise->discard();
1482 }
1483}
1484
1485
1486template <typename T, typename X>

Callers

nothing calls this directly

Calls 9

isReadyMethod · 0.80
hasDiscardMethod · 0.80
associateMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
isDiscardedMethod · 0.80
discardMethod · 0.45
getMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected