mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-10-04 21:00:53 +02:00
use associated executors for intermediate handlers
Summary: * per-operation cancellation changed: total/partial signals only prevent further resending, terminal signal cancels the whole client Reviewers: ivica Reviewed By: ivica Subscribers: korina Differential Revision: https://repo.mireo.local/D27246
This commit is contained in:
@@ -36,9 +36,9 @@ public:
|
||||
resolve_op(resolve_op&&) noexcept = default;
|
||||
resolve_op(const resolve_op&) = delete;
|
||||
|
||||
using executor_type = typename Owner::executor_type;
|
||||
using executor_type = asio::associated_executor_t<handler_type>;
|
||||
executor_type get_executor() const noexcept {
|
||||
return _owner.get_executor();
|
||||
return asio::get_associated_executor(_handler);
|
||||
}
|
||||
|
||||
using allocator_type = asio::associated_allocator_t<handler_type>;
|
||||
@@ -104,20 +104,14 @@ private:
|
||||
void complete(error_code ec, epoints eps, authority_path ap) {
|
||||
get_cancellation_slot().clear();
|
||||
|
||||
asio::dispatch(
|
||||
get_executor(),
|
||||
asio::prepend(
|
||||
std::move(_handler), ec,
|
||||
std::move(eps), std::move(ap)
|
||||
)
|
||||
);
|
||||
std::move(_handler)(ec, std::move(eps), std::move(ap));
|
||||
}
|
||||
|
||||
void complete_post(error_code ec, epoints eps, authority_path ap) {
|
||||
get_cancellation_slot().clear();
|
||||
|
||||
asio::post(
|
||||
get_executor(),
|
||||
_owner.get_executor(),
|
||||
asio::prepend(
|
||||
std::move(_handler), ec,
|
||||
std::move(eps), std::move(ap)
|
||||
|
Reference in New Issue
Block a user