With boost 1.86 some tokens (namely cancel_at and cancel_after) and the partial tokens use the associated_executor from the initiation object. This allows the following:
c.async_publish<async_mqtt5::qos_e::at_most_once>(
"<topic>", "Hello world!",
async_mqtt5::retain_e::no, async_mqtt5::publish_props {},
asio::cancel_after([&c](async_mqtt5::error_code ec) {
std::cout << ec.message() << std::endl;
c.async_disconnect(boost::asio::detached); // disconnect and close the client
}, std::chrono::milliseconds(100)));
);
it will also allow partial tokens, e.g. the following:
With boost 1.86 some tokens (namely
cancel_at
andcancel_after
) and the partial tokens use theassociated_executor
from the initiation object. This allows the following:it will also allow partial tokens, e.g. the following: