20#ifndef ORES_COMMS_NET_RESPONSE_CHANNEL_HPP
21#define ORES_COMMS_NET_RESPONSE_CHANNEL_HPP
26#include <boost/asio/any_io_executor.hpp>
27#include <boost/asio/awaitable.hpp>
28#include <boost/asio/steady_timer.hpp>
29#include <boost/asio/use_awaitable.hpp>
30#include "ores.comms/messaging/frame.hpp"
31#include "ores.comms/messaging/message_types.hpp"
83 boost::asio::awaitable<std::expected<messaging::frame, messaging::error_code>>
get();
91 boost::asio::steady_timer signal_;
92 mutable std::mutex mutex_;
93 std::optional<messaging::frame> response_;
94 std::optional<messaging::error_code> error_;
Contains the networking elements of the comms library.
Definition client.hpp:42
Complete frame with header and payload.
Definition frame.hpp:77
Single-value async channel for delivering a response frame.
Definition response_channel.hpp:46
boost::asio::awaitable< std::expected< messaging::frame, messaging::error_code > > get()
Wait for and retrieve the response (consumer side).
Definition response_channel.cpp:61
void set_error(messaging::error_code ec)
Set an error (producer side).
Definition response_channel.cpp:47
bool is_ready() const
Check if the channel has already received a value or error.
Definition response_channel.cpp:93
void set_value(messaging::frame response)
Set the response value (producer side).
Definition response_channel.cpp:34