18 using Sender = std::function<
19 void(T
const&, boost::asio::basic_yield_context<boost::asio::any_io_executor>)>;
25 bool isSending_{
false};
28 SendingQueue(Sender sender) : sender_{std::move(sender)}
32 std::expected<void, Error>
33 send(T message, boost::asio::yield_context yield)
36 return std::unexpected{error_};
38 queue_.push(std::move(message));
43 while (not queue_.empty() and not error_) {
44 auto const responseToSend = std::move(queue_.front());
46 sender_(responseToSend, yield[error_]);
50 return std::unexpected{error_};