32 template <
typename ContextType, SomeOutcome OutcomeType>
33 [[nodiscard]]
static auto
34 dispatch(ContextType& ctx, OutcomeType&& outcome,
auto&& fn)
36 auto op = outcome.getOperation();
40 [outcome = std::forward<
decltype(outcome)>(outcome),
41 fn = std::forward<
decltype(fn)>(fn)](
auto yield)
mutable {
42 if constexpr (SomeStoppableOutcome<OutcomeType>) {
43 auto& stopSource = outcome.getStopSource();
44 fn(outcome, stopSource, stopSource[yield]);
56 template <
typename ContextType, SomeOutcome OutcomeType>
57 [[nodiscard]]
static auto
58 dispatch(ContextType& ctx, OutcomeType&& outcome,
auto&& fn)
60 auto op = outcome.getOperation();
64 [outcome = std::forward<
decltype(outcome)>(outcome), fn = std::forward<
decltype(fn)>(fn)]()
mutable {
65 if constexpr (SomeStoppableOutcome<OutcomeType>) {
66 auto& stopSource = outcome.getStopSource();
67 fn(outcome, stopSource, stopSource.getToken());
79 template <
typename ContextType, SomeOutcome OutcomeType>
80 [[nodiscard]]
static auto
81 dispatch([[maybe_unused]] ContextType& ctx, OutcomeType outcome,
auto&& fn)
83 auto op = outcome.getOperation();
86 auto& stopSource = outcome.getStopSource();
87 fn(outcome, stopSource, stopSource.getToken());
Definition Execution.hpp:55