Message bus future class.
More...
#include <eagine/message_bus/future.hpp>
|
| future ()=default |
| Default constructor.
|
|
| future (nothing_t) noexcept |
| Constructs empty stateless future.
|
|
| operator bool () const noexcept |
| Checks if the future has state (is associated with a promise).
|
|
template<typename R , typename P > |
auto | set_timeout (std::chrono::duration< R, P > dur) -> future< T > & |
| Sets the timeout for this future if there is shared state.
|
|
auto | on_success (const std::function< void(T)> &handler) -> future< T > & |
| Sets the on-success handler. More...
|
|
auto | on_timeout (const std::function< void()> &handler) -> future< T > & |
| Sets the on-timeout handler. More...
|
|
template<typename Handler , typename = std::enable_if_t<std::is_invocable_v<Handler, T>>> |
auto | then (Handler handler) -> future< T > & |
| Wraps the given handler object and sets it as the on-success handler. More...
|
|
template<typename Handler , typename = std::enable_if_t<std::is_invocable_v<Handler>>> |
auto | otherwise (Handler handler) -> future< T > & |
| Wraps the given handler object and sets it as the on-timeout handler. More...
|
|
auto | get_promise () -> promise< T > |
| Returns the associated promise it there is shared state.
|
|
template<typename T>
class eagine::msgbus::future< T >
Message bus future class.
- See also
- promise
-
pending_promises
◆ on_success()
◆ on_timeout()
◆ otherwise()
template<typename T >
template<typename Handler , typename = std::enable_if_t<std::is_invocable_v<Handler>>>
Wraps the given handler object and sets it as the on-timeout handler.
- See also
- on_timeout
-
then
◆ then()
template<typename T >
template<typename Handler , typename = std::enable_if_t<std::is_invocable_v<Handler, T>>>
Wraps the given handler object and sets it as the on-success handler.
- See also
- on_success
-
otherwise
The documentation for this class was generated from the following file: