22#include "util/async/context/impl/Cancellation.hpp"
29template <
typename RetType,
typename StopSourceType>
34template <
typename RetType>
42template <
typename RetType>
45 std::promise<RetType> promise_;
48 using DataType = RetType;
61 setValue(std::convertible_to<RetType>
auto&& val)
63 promise_.set_value(std::forward<
decltype(val)>(val));
72 promise_.set_value({});
80 [[nodiscard]] std::future<RetType>
83 return promise_.get_future();
94template <
typename RetType>
115template <
typename RetType,
typename StopSourceType>
118 StopSourceType stopSource_;
137 [[nodiscard]] StopSourceType&
Unstoppable outcome.
Definition Outcome.hpp:95
impl::BasicOperation< Outcome > getOperation()
Gets the unstoppable operation for this outcome.
Definition Outcome.hpp:103
The future side of async operations that can be stopped.
Definition Outcome.hpp:30
Stoppable outcome.
Definition Outcome.hpp:116
StoppableOperation< RetType, StopSourceType > getOperation()
Gets the stoppable operation for this outcome.
Definition Outcome.hpp:127
StopSourceType & getStopSource()
Gets the stop source for this outcome.
Definition Outcome.hpp:138
Definition Outcome.hpp:35
Base for all promise side of async operations.
Definition Outcome.hpp:43
void setValue(std::convertible_to< RetType > auto &&val)
Sets the value on the inner promise
Definition Outcome.hpp:61
std::future< RetType > getStdFuture()
Get the future for the inner promise
Definition Outcome.hpp:81
void setValue()
Sets the value channel for void operations.
Definition Outcome.hpp:70
This namespace implements an async framework built on top of execution contexts.
Definition AnyExecutionContext.hpp:36