Skip to content

Commit

Permalink
perf: Include Asio co_spawn.hpp and use_awaitable.hpp only through re…
Browse files Browse the repository at this point in the history
…gister_awaitable_rpc_handler.hpp
  • Loading branch information
Tradias committed Dec 26, 2023
1 parent cd65f03 commit dc36433
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 103 deletions.
52 changes: 33 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ if(ASIO_GRPC_BUILD_TESTS AND ASIO_GRPC_ENABLE_CHECK_HEADER_SYNTAX_TARGET)
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/alarm.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/asio_grpc.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/client_rpc.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/default_server_rpc_traits.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/grpc_context.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/grpc_executor.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/notify_on_state_change.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/read.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_awaitable_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_callback_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_sender_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_yield_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/rpc_type.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/run.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/server_rpc.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/server_rpc_ptr.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/test.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/use_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/waiter.hpp")

target_sources(
asio-grpc-sources
INTERFACE # cmake-format: sort
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/alarm.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/algorithm.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/allocate.hpp"
Expand All @@ -68,46 +88,52 @@ if(ASIO_GRPC_BUILD_TESTS AND ASIO_GRPC_ENABLE_CHECK_HEADER_SYNTAX_TARGET)
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/asio_utils.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/associated_completion_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/association.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/association_asio.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/atomic.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/atomic_bool_stop_context.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/atomic_intrusive_queue.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/awaitable.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/backoff.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/basic_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/bind_allocator.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/buffer_allocator.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/client_rpc_base.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/client_rpc_context_base.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/client_rpc_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/config.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/coroutine_traits.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/create_and_submit_no_arg_operation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/deallocate_on_complete.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/default_completion_token.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/execution.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/execution_asio.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/execution_unifex.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/executor_with_default.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/forward.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/functional.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_completion_queue_event.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_context.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_context.ipp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_context_implementation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_context_implementation.ipp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_executor_base.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_executor_options.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/grpc_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/health_check_repeatedly_request.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/initiate_sender_implementation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/intrusive_circular_list.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/intrusive_list.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/intrusive_list_hook.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/intrusive_queue.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/intrusive_slist.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/manual_reset_event.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/math.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/memory.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/name.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/namespace_cpp20.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/notify_on_state_change.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/notify_when_done_event.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/operation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/operation_base.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/operation_handle.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/operation_implementation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/operation_initiation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/pool_resource.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/pool_resource_allocator.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/query_grpc_context.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/receiver.hpp"
Expand All @@ -120,6 +146,7 @@ if(ASIO_GRPC_BUILD_TESTS AND ASIO_GRPC_ENABLE_CHECK_HEADER_SYNTAX_TARGET)
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/rethrow_first_arg.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/rpc_executor_base.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/rpc_request.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/rpc_type.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/schedule_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/sender_implementation.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/sender_implementation_operation.hpp"
Expand All @@ -141,18 +168,5 @@ if(ASIO_GRPC_BUILD_TESTS AND ASIO_GRPC_ENABLE_CHECK_HEADER_SYNTAX_TARGET)
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/utility.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/wait.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/waiter.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/work_tracking_completion_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/grpc_context.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/grpc_executor.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/notify_on_state_change.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/read.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_awaitable_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_callback_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_sender_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/register_yield_rpc_handler.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/run.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/server_rpc.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/test.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/use_sender.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/waiter.hpp")
"${CMAKE_CURRENT_SOURCE_DIR}/agrpc/detail/work_tracking_completion_handler.hpp")
endif()
14 changes: 0 additions & 14 deletions src/agrpc/detail/asio_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
#include <asio/query.hpp>
#include <asio/system_executor.hpp>

#ifdef ASIO_HAS_CO_AWAIT
#include <asio/co_spawn.hpp>
#include <asio/use_awaitable.hpp>

#define AGRPC_ASIO_HAS_CO_AWAIT
#endif

#if (ASIO_VERSION >= 101900)
#include <asio/associated_cancellation_slot.hpp>
#include <asio/bind_cancellation_slot.hpp>
Expand Down Expand Up @@ -86,13 +79,6 @@
#include <boost/asio/query.hpp>
#include <boost/asio/system_executor.hpp>

#ifdef BOOST_ASIO_HAS_CO_AWAIT
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/use_awaitable.hpp>

#define AGRPC_ASIO_HAS_CO_AWAIT
#endif

#if (BOOST_VERSION >= 107700)
#include <boost/asio/associated_cancellation_slot.hpp>
#include <boost/asio/bind_cancellation_slot.hpp>
Expand Down
36 changes: 36 additions & 0 deletions src/agrpc/detail/awaitable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2023 Dennis Hezel
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef AGRPC_DETAIL_AWAITABLE_HPP
#define AGRPC_DETAIL_AWAITABLE_HPP

#ifdef AGRPC_STANDALONE_ASIO
#include <asio/use_awaitable.hpp>

#ifdef ASIO_HAS_CO_AWAIT
#include <asio/co_spawn.hpp>

#define AGRPC_ASIO_HAS_CO_AWAIT
#endif
#elif defined(AGRPC_BOOST_ASIO)
#include <boost/asio/use_awaitable.hpp>

#ifdef BOOST_ASIO_HAS_CO_AWAIT
#include <boost/asio/co_spawn.hpp>

#define AGRPC_ASIO_HAS_CO_AWAIT
#endif
#endif

#endif // AGRPC_DETAIL_AWAITABLE_HPP
43 changes: 5 additions & 38 deletions src/agrpc/detail/coroutine_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,15 @@
#define AGRPC_DETAIL_COROUTINE_TRAITS_HPP

#include <agrpc/detail/asio_forward.hpp>
#include <agrpc/detail/awaitable.hpp>
#include <agrpc/detail/config.hpp>
#include <agrpc/detail/rethrow_first_arg.hpp>
#include <agrpc/detail/utility.hpp>

#ifdef AGRPC_ASIO_HAS_CO_AWAIT

AGRPC_NAMESPACE_BEGIN()

namespace detail
{
struct CompletionHandlerUnknown
{
};

template <class CompletionToken, class Signature, class = void>
struct HandlerType
{
using Type = CompletionHandlerUnknown;
};

template <class CompletionToken, class Signature>
struct HandlerType<CompletionToken, Signature,
std::void_t<typename asio::async_result<CompletionToken, Signature>::handler_type>>
{
using Type = typename asio::async_result<CompletionToken, Signature>::handler_type;
};

template <class CompletionToken, class Signature, class = void>
struct CompletionHandlerType
{
using Type = typename detail::HandlerType<CompletionToken, Signature>::Type;
};

template <class CompletionToken, class Signature>
struct CompletionHandlerType<
CompletionToken, Signature,
std::void_t<typename asio::async_result<CompletionToken, Signature>::completion_handler_type>>
{
using Type = typename asio::async_result<CompletionToken, Signature>::completion_handler_type;
};

template <class CompletionToken, class Signature>
using CompletionHandlerTypeT = typename CompletionHandlerType<CompletionToken, Signature>::Type;

#ifdef AGRPC_ASIO_HAS_CO_AWAIT
template <class Coroutine>
struct CoroutineTraits;

Expand All @@ -80,9 +46,10 @@ using CoroutineCompletionTokenT = typename detail::CoroutineTraits<Coroutine>::C

template <class Coroutine>
using CoroutineExecutorT = typename detail::CoroutineTraits<Coroutine>::ExecutorType;
#endif
}

AGRPC_NAMESPACE_END

#endif

#endif // AGRPC_DETAIL_COROUTINE_TRAITS_HPP
8 changes: 1 addition & 7 deletions src/agrpc/detail/default_completion_token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ AGRPC_NAMESPACE_BEGIN()

namespace detail
{
#ifdef AGRPC_ASIO_HAS_CO_AWAIT
using DefaultCompletionToken = asio::use_awaitable_t<>;
#else
using DefaultCompletionToken = agrpc::UseSender;
#endif

#if defined(AGRPC_STANDALONE_ASIO) || defined(AGRPC_BOOST_ASIO)
#if defined(AGRPC_UNIFEX) || defined(AGRPC_STDEXEC)
template <class Executor>
Expand All @@ -40,7 +34,7 @@ using DefaultCompletionTokenT = asio::default_completion_token_t<Executor>;
#endif
#else
template <class>
using DefaultCompletionTokenT = detail::DefaultCompletionToken;
using DefaultCompletionTokenT = agrpc::UseSender;
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions src/agrpc/detail/notify_when_done_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include <agrpc/detail/asio_forward.hpp>
#include <agrpc/detail/config.hpp>
#include <agrpc/detail/manual_reset_event.hpp>
#include <agrpc/detail/operation_base.hpp>
#include <agrpc/detail/tuple.hpp>
#include <agrpc/grpc_executor.hpp>
#include <agrpc/use_sender.hpp>
#include <grpcpp/server_context.h>

Expand Down
1 change: 1 addition & 0 deletions src/agrpc/detail/register_awaitable_rpc_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef AGRPC_DETAIL_REGISTER_AWAITABLE_RPC_HANDLER_HPP
#define AGRPC_DETAIL_REGISTER_AWAITABLE_RPC_HANDLER_HPP

#include <agrpc/detail/awaitable.hpp>
#include <agrpc/detail/bind_allocator.hpp>
#include <agrpc/detail/config.hpp>
#include <agrpc/detail/coroutine_traits.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/agrpc/detail/register_rpc_handler_asio_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <agrpc/detail/association.hpp>
#include <agrpc/detail/buffer_allocator.hpp>
#include <agrpc/detail/config.hpp>
#include <agrpc/detail/coroutine_traits.hpp>
#include <agrpc/detail/register_rpc_handler_base.hpp>
#include <agrpc/detail/rethrow_first_arg.hpp>
#include <agrpc/detail/rpc_request.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/agrpc/detail/server_write_reactor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <agrpc/detail/operation_base.hpp>
#include <agrpc/grpc_context.hpp>
#include <agrpc/grpc_executor.hpp>
#include <grpcpp/server_context.h>
#include <grpcpp/support/async_stream.h>

AGRPC_NAMESPACE_BEGIN()

Expand Down
1 change: 1 addition & 0 deletions src/agrpc/register_awaitable_rpc_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define AGRPC_AGRPC_REGISTER_AWAITABLE_RPC_HANDLER_HPP

#include <agrpc/detail/asio_forward.hpp>
#include <agrpc/detail/awaitable.hpp>
#include <agrpc/detail/config.hpp>

#ifdef AGRPC_ASIO_HAS_CO_AWAIT
Expand Down
25 changes: 11 additions & 14 deletions test/src/test_grpc_context_17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,27 +238,24 @@ TEST_CASE_FIXTURE(GrpcExecutorTest, "GrpcExecutor comparison operator - differen
TEST_CASE_FIXTURE(GrpcExecutorTest, "GrpcExecutor comparison operator - different allocator")
{
CHECK_EQ(get_executor(), asio::require(get_executor(), asio::execution::allocator));
auto default_pmr_executor = asio::require(get_executor(), asio::execution::allocator(test::TrackingAllocator<>()));
auto default_pmr_other_executor =
auto alloc_executor = asio::require(get_executor(), asio::execution::allocator(test::TrackingAllocator<>()));
auto other_alloc_executor =
asio::require(other_executor(), asio::execution::allocator(test::TrackingAllocator<>()));
SUBCASE("same options")
{
CHECK_EQ(default_pmr_executor, default_pmr_executor);
CHECK_NE(default_pmr_executor,
asio::require(default_pmr_executor, asio::execution::allocator(get_allocator())));
CHECK_NE(default_pmr_other_executor, default_pmr_executor);
CHECK_NE(default_pmr_other_executor,
asio::require(default_pmr_executor, asio::execution::allocator(get_allocator())));
CHECK_EQ(alloc_executor, alloc_executor);
CHECK_NE(alloc_executor, asio::require(alloc_executor, asio::execution::allocator(get_allocator())));
CHECK_NE(other_alloc_executor, alloc_executor);
CHECK_NE(other_alloc_executor, asio::require(alloc_executor, asio::execution::allocator(get_allocator())));
}
SUBCASE("different options")
{
CHECK_NE(default_pmr_executor, asio::require(default_pmr_executor, asio::execution::blocking_t::possibly));
CHECK_NE(default_pmr_executor, asio::require(default_pmr_executor, asio::execution::blocking_t::possibly,
CHECK_NE(alloc_executor, asio::require(alloc_executor, asio::execution::blocking_t::possibly));
CHECK_NE(alloc_executor, asio::require(alloc_executor, asio::execution::blocking_t::possibly,
asio::execution::allocator(get_allocator())));
CHECK_NE(other_alloc_executor, asio::require(alloc_executor, asio::execution::blocking_t::possibly));
CHECK_NE(other_alloc_executor, asio::require(alloc_executor, asio::execution::blocking_t::possibly,
asio::execution::allocator(get_allocator())));
CHECK_NE(default_pmr_other_executor,
asio::require(default_pmr_executor, asio::execution::blocking_t::possibly));
CHECK_NE(default_pmr_other_executor, asio::require(default_pmr_executor, asio::execution::blocking_t::possibly,
asio::execution::allocator(get_allocator())));
}
}

Expand Down
13 changes: 3 additions & 10 deletions test/utils/utils/asio_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define AGRPC_UTILS_ASIO_FORWARD_HPP

#include <agrpc/detail/asio_forward.hpp>
#include <agrpc/detail/awaitable.hpp>

#ifdef AGRPC_STANDALONE_ASIO
#include <asio/coroutine.hpp>
Expand All @@ -28,13 +29,9 @@
#include <asio/thread_pool.hpp>
#include <asio/use_future.hpp>

#ifdef AGRPC_ASIO_HAS_CO_AWAIT
#include <asio/co_spawn.hpp>

#ifdef AGRPC_ASIO_HAS_CANCELLATION_SLOT
#if defined(AGRPC_ASIO_HAS_CO_AWAIT) && defined(AGRPC_ASIO_HAS_CANCELLATION_SLOT)
#include <asio/experimental/awaitable_operators.hpp>
#endif
#endif

#ifdef AGRPC_ASIO_HAS_CANCELLATION_SLOT
#include <asio/bind_cancellation_slot.hpp>
Expand Down Expand Up @@ -76,13 +73,9 @@
#include <boost/asio/thread_pool.hpp>
#include <boost/asio/use_future.hpp>

#ifdef AGRPC_ASIO_HAS_CO_AWAIT
#include <boost/asio/co_spawn.hpp>

#ifdef AGRPC_ASIO_HAS_CANCELLATION_SLOT
#if defined(AGRPC_ASIO_HAS_CO_AWAIT) && defined(AGRPC_ASIO_HAS_CANCELLATION_SLOT)
#include <boost/asio/experimental/awaitable_operators.hpp>
#endif
#endif

#ifdef AGRPC_ASIO_HAS_CANCELLATION_SLOT
#include <boost/asio/bind_cancellation_slot.hpp>
Expand Down

0 comments on commit dc36433

Please sign in to comment.