37 using Sender = std::function<void(T
const&, boost::asio::basic_yield_context<boost::asio::any_io_executor>)>;
43 bool isSending_{
false};
46 SendingQueue(Sender sender) : sender_{std::move(sender)}
50 std::expected<void, Error>
51 send(T message, boost::asio::yield_context yield)
54 return std::unexpected{error_};
56 queue_.push(std::move(message));
61 while (not queue_.empty() and not error_) {
62 auto const responseToSend = std::move(queue_.front());
64 sender_(responseToSend, yield[error_]);
68 return std::unexpected{error_};