]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/async: handler wrappers forward associated cancellation_slot
authorCasey Bodley <cbodley@redhat.com>
Thu, 12 Jan 2023 02:02:57 +0000 (21:02 -0500)
committerAdam Emerson <aemerson@redhat.com>
Thu, 14 Sep 2023 21:48:00 +0000 (17:48 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/async/bind_handler.h
src/common/async/forward_handler.h

index 516d8a5e8b41fc665af235b2014a910816c5ed6a..4eae961c15fd7af8dd5afe58841e7b575268dc10 100644 (file)
@@ -56,6 +56,11 @@ struct CompletionHandler {
   allocator_type get_allocator() const noexcept {
     return boost::asio::get_associated_allocator(handler);
   }
+
+  using cancellation_slot_type = boost::asio::associated_cancellation_slot_t<Handler>;
+  cancellation_slot_type get_cancellation_slot() const noexcept {
+    return boost::asio::get_associated_cancellation_slot(handler);
+  }
 };
 
 } // namespace ceph::async
index ae88cc83f46478ed99eb8298ce8f4a6b21b3c075..e51f3fa76bc8fd221bb6f77749cee077ec833d03 100644 (file)
@@ -51,6 +51,11 @@ struct ForwardingHandler {
   allocator_type get_allocator() const noexcept {
     return boost::asio::get_associated_allocator(handler);
   }
+
+  using cancellation_slot_type = boost::asio::associated_cancellation_slot_t<Handler>;
+  cancellation_slot_type get_cancellation_slot() const noexcept {
+    return boost::asio::get_associated_cancellation_slot(handler);
+  }
 };
 
 } // namespace ceph::async