37 using Sender = std::function<
38 void(T
const&, boost::asio::basic_yield_context<boost::asio::any_io_executor>)>;
44 bool isSending_{
false};
47 SendingQueue(Sender sender) : sender_{std::move(sender)}
51 std::expected<void, Error>
52 send(T message, boost::asio::yield_context yield)
55 return std::unexpected{error_};
57 queue_.push(std::move(message));
62 while (not queue_.empty() and not error_) {
63 auto const responseToSend = std::move(queue_.front());
65 sender_(responseToSend, yield[error_]);
69 return std::unexpected{error_};