From 5073ec9a4082ea8bd6b5603ee1e3a7ea276b8302 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 29 Aug 2021 18:12:44 +0200 Subject: [PATCH] feat: Associate executor and allocator of initiating function in grpc_initiate --- src/agrpc/detail/initiate.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/agrpc/detail/initiate.hpp b/src/agrpc/detail/initiate.hpp index 2fa4400e..6f211445 100644 --- a/src/agrpc/detail/initiate.hpp +++ b/src/agrpc/detail/initiate.hpp @@ -24,6 +24,9 @@ namespace agrpc::detail template struct GrpcInitiator { + using executor_type = asio::associated_executor_t; + using allocator_type = asio::associated_allocator_t; + struct OnWork { agrpc::GrpcContext& grpc_context; @@ -46,6 +49,10 @@ struct GrpcInitiator detail::create_work(grpc_context, std::move(completion_handler), OnWork{grpc_context, function}, allocator); } + + executor_type get_executor() const noexcept { return asio::get_associated_executor(function); } + + allocator_type get_allocator() const noexcept { return asio::get_associated_allocator(function); } }; template