Skip to content

Releases: Tradias/asio-grpc

v2.8.0

10 Dec 16:19
Compare
Choose a tag to compare

Features

Fixes

  • Removed all usage of pointer tagging. Although Asio uses it, it is technically undefined behavior.

Performance

Documentation

  • Use Asio's default completion token mechanism in examples.
  • Avoid using asio::detached in examples since it swallows exceptions.
  • Document how register_awaitable_rpc_handler and register_yield_rpc_handler obtain the executor used to spawn the coroutine.
  • Removed documentation of deprecated CMake options.

Chore

  • Remove codeql pipeline

v2.7.0

28 Oct 14:32
Compare
Choose a tag to compare

This release prepares asio-grpc for a large trim down in the next major release by adding an API that follows Asio's I/O object model more closely, avoids the pitfalls of the current API and provides more customization options.

The following headers should be considered deprecated:
bind_allocator.hpp, cancel_safe.hpp, default_completion_token.hpp, get_completion_queue.hpp, grpc_initiate.hpp, grpc_stream.hpp, notify_when_done.hpp, repeatedly_request_context.hpp, repeatedly_request.hpp, rpc.hpp, use_awaitable.hpp, wait.hpp

Features

  • Add agrpc::ServerRPC, new API for asynchronous servers.
  • Add agrpc::register_awaitable_rpc_handler, agrpc::register_yield_rpc_handler and agrpc::register_sender_rpc_handler functions for setting up request handling with agrpc::ServerRPC.
  • Breaking change in experimental agrpc::ClientRPC API:
    • Rename agrpc::ClientRPCGenericUnary to agrpc::GenericUnaryClientRPC.
    • Rename agrpc::ClientRPCGenericStreaming to agrpc::GenericStreamingClientRPC.
  • Make unary ClientRPCs constructible and add start, read_initial_metadata and finish member functions.

Fixes

  • Avoid UB from casting function pointer to void* in ClientRPC, BasicAlarm and notify_one_state_change asynchronous operations.
  • Consistently take CompletionToken by forwarding-reference.

Performance

  • Improve compile times of ClientRPC, BasicAlarm and notify_one_state_change asynchronous operations.

Documentation

  • Remove documentation of old API.

Chore

  • Run sonarscanner on Ubuntu 22.04 with GCC 11 and Java 17.
  • Use vcpkg binarycaching with Github Caches.

v2.6.0

30 Jul 10:46
Compare
Choose a tag to compare

Features

  • Breaking change in experimental agrpc::RPC API:
    • Rename to agrpc::ClientRPC and agrpc::ClientRPCType.
    • Header name changed to client_rpc.hpp.
    • asio::use_awaitable is no longer the default completion token.
    • Remove third template parameter.
    • For streaming specializations:
      • ClientRPC now creates and owns the grpc::ClientContext, it can be customized during construction or later access using context().
      • Must now be started by calling start(), request() has been removed.
      • finish() and writes_done() no longer guard against being called multiple times.
    • For generic specializations:
      • Replace marker values agrpc::CLIENT_GENERIC_X_RPC with agrpc::ClientRPCType::GENERIC_X.
      • Add type aliases agrpc::ClientRPCGenericUnary<Executor> and agrpc::ClientRPCGenericStreaming<Executor>.
  • De-experimentalize agrpc::HealthCheckService.
  • Add cancel() to agrpc::Alarm.
  • Add support for libunifex v0.2.0 to agrpc::repeatedly_request.

Fixes

  • Typo in NotfiyWhenDoneFn

Documentation

  • Simplify file-transfer example.

Chore

  • Update libunifex to v0.2.0. Version 0.3.0 is also supported by held back due to an ICE in clang 10.

v2.5.1

17 Mar 10:24
Compare
Choose a tag to compare

Fixes

  • Remove Intellisense workaround from agrpc::RPC's RPCType deduction because it causes ICE since Visual Studio 17.5 (C++20 only). See bug report.
  • Bump asio-grpc version in CMakeLists file.

v2.5.0

13 Mar 11:31
Compare
Choose a tag to compare

Features

  • Implement a pool memory resource based on Boost.Container's unsynchronized_pool_resource. This makes selecting between <memory_resource>, Boost.Container and asio::recycling_allocator obsolete. All related CMake options have been marked deprecated and only affect uses_allocator specializations now. They will be removed in version 3 which will always use std::uses_allocator.
  • Deprecated: Due to the above, all typedefs in the agrpc::pmr namespace are deprecated and will be removed in v3.
  • Add a new CMake option called ASIO_GRPC_BUILD_EXAMPLES which enables compilation of just examples without tests. Also, libunifex is now treated as an optional dependency.

Fixes

  • agrpc::run* consumes a high amount of CPU resources when the GrpcContext had already stopped while the second argument (typically an io_context) had work left to do. To resolve that, agrpc::run* will now end when both contexts are stopped using new functions that were added to the RunTraits.

Documentation

  • Create an article on the use of asio::io_context.

Chore

  • Treat compiler warnings as error in CI.

v2.4.0

29 Dec 18:01
Compare
Choose a tag to compare

Features

  • Add cancellation support to agrpc::RPC.
  • Add a new install option to use asio::recycling_allocator instead of <memory_resource> or Boost.Container. This can be handy in combination with libc++ and standalone Asio to avoid taking a dependency on Boost.
  • Deprecated: Constructor agrpc::GrpcContext{std::make_unique<grpc::CompletionQueue>()}, use the new default constructor instead.
  • Deprecated: Member function agrpc::CancelSafe::is_running has been renamed to is_wait_pending() because it never reported whether the asynchronous operation is still running but instead whether a wait is currently pending.

Fixes

  • A failed write with grpc::WriteOptions::set_last_message on a high-level client streaming RPC incorrectly completes with true.
  • The operation state obtained by connecting a receiver to the sender returned by agprc::notify_when_done is deallocated during GrpcContext destruction, leading to double free because the lifetime of the operation state is expected to be handled by the connector.
  • Using asio::deferred for agrpc::RPC::finish and agrpc::RPC::writes_done does not compile.
  • The rvalue-overload of agrpc::Alarm::wait does not extend the lifetime of the alarm correctly when using completion tokens like asio::deferred.
  • Honor ASIO_GRPC_USE_BOOST_CONTAINER CMake variable when using asio-grpc with add_subdirectory.
  • Compatibility of sender/receiver with Asio 1.25/Boost 1.81.

Performance

  • Improve performance of high-level client read_initial_metadata, read, write and finish by replacing some if-conditions with compile time dispatch.
  • Reduce allocation size of each health check watch request.
  • Reduce size of all sender operation states by one pointer and the notify_when_done operation state by two pointers.

Documentation

  • Correctly state that agrpc::RPC::read_initial_metadata may not be called concurrently with write.

Chore

  • Adjust .clang-tidy rules.
  • Fix CMAKE_UNITY_BUILD and enable it for some CI builds.
  • Add test for add_subdirectory-consumption of asio-grpc.
  • Update doxygen and doxygen-awesome.

v2.3.0

06 Nov 13:02
Compare
Choose a tag to compare

Features

Chore

  • Update libunifex to 2022-10-10 and gRPC to 1.50.1

v2.2.0

20 Oct 17:39
Compare
Choose a tag to compare

Features

  • Add agrpc::RPC<>::service/method_name():
package example.v1;
 
service Example { rpc Unary(Request) returns (Response) {} }
using RPC = agrpc::RPC<&example::v1::Example::Stub::PrepareAsyncUnary>;
static_assert(RPC::service_name() == "example.v1.Example");
static_assert(RPC::method_name() == "Unary");
  • Add agrpc::Alarm, an I/O object that wraps grpc::Alarm. A safer alternative to the agrpc::wait free function. Additionally supports ad-hoc waits which automatically extend the lifetime of the underlying gRPC alarm, for example with a callback:
agrpc::Alarm(grpc_context).wait(deadline, [](bool ok, agrpc::Alarm&& alarm) {});

Fixes

  • Leak of uncompleted sender operation states and asynchronous operations started by the high-level client API upon destruction of the GrpcContext.
  • For each request in the sender overload of agrpc::repeatedly_request, make a copy of the request handler to avoid lifetime surprises when the handler returns unifex::task<>.

Performance

  • Improve compile times by no longer instantiating entire operation states with two different allocators, but instead only their completion function. This affects all free functions, like agrpc::read and agrpc::wait, as well as the high-level client API.

Chore

  • Use a more meticulous gRPC shutdown sequence in tests to make them less flaky.
  • Update tests and examples to Boost 1.80.

v2.1.0

06 Sep 17:12
Compare
Choose a tag to compare

Features

  • Add a high-level client API - a new major feature that makes writing asynchronous gRPC clients easier and safer.
  • In asio_grpc_protobuf_generate, check the validity of IMPORT_DIRS at CMake configure time instead of build time.
  • The asio-grpc source files can now be consumed without CMake. In that case, the compile definition AGRPC_USE_BOOST_CONTAINER can be used to choose between <memory_resource> and Boost.Container.

Fixes

  • Enable cancellation support for standalone Asio 1.19.0 instead of 1.20.0. Note that throwing exceptions from the request handler of agrpc::repeatedly_request crashes until 1.19.2.
  • Correctly handle .proto filenames that include dots in asio_grpc_protobuf_generate.
  • Return correct sender from asio::execution::schedule(GrpcExecutor) when compiling in C++17 using MSVC.

Performance

  • Turn cancellation check in agrpc::repeatedly_request to a no-op when the completion handler does not support cancellation.
  • Replace most calls to std::move and std::forward with static_cast and use a simpler version of std::tuple to improve compile times.

Documentation

  • State that read_initial_metadata will not complete until the server calls write_initial_metadata or the client performs a write/finish.
  • Add generic bidirectional streaming example.
  • Add dark mode to documentation website.

Chore

  • No longer run CodeQL in Github Actions since it stopped working and never diagnosed anything useful.

v2.0.0

24 Jul 13:16
Compare
Choose a tag to compare

Breaking change: All headers now use snake_case instead of camelCase, e.g. #include <agrpc/asioGrpc.hpp> becomes #include <agrpc/asio_grpc.hpp>.

Breaking change: Two overloads for requesting unary RPCs have been removed, example: co_await agrpc::request(&example::v1::Example::Stub::AsyncUnary, stub, client_context, request). Please use other means of obtaining a reference to the agrpc::GrpcContext and then call agrpc::request(&example::v1::Example::Stub::AsyncUnary, stub, client_context, request, grpc_context).

Breaking change: Unsafe overloads of agrpc::get_completion_queue have been removed.

Breaking change: asio-grpcConfig.cmake will now autolink with gRPC::grpc++_unsecure instead of gRPC::grpc++. If you are using encrypted gRPC then you need to explicitly link with gRPC::grpc++ in your CMake files.

Breaking change: If the completion handler passed to an asynchronous operation does not have an associated allocator then asio-grpc will no longer attempt to retrieve one from the associated executor through asio::query(executor, asio::execution::allocator). This behavior had been deprecated in v1.6.0.

Features

  • Add run_until(deadline) to agrpc::GrpcContext.
  • Add PrepareAsync overloads for requesting RPCs in a thread-safe manner.
  • Deprecate the Async overloads for requesting client-side streaming RPCs as they can lead to race-conditions.
  • Add agrpc::BasicGrpcStream overload to agrpc::get_completion_queue.
  • Make agrpc::AllocatorBinder fully constexpr compatible.

Style

  • No longer use std::aligned_storage since it is deprecated in C++23.
  • Continue to implement compile time improvements.

Documentation

  • Add examples for multi-threaded clients and servers.
  • Make the ServerShutdown that is used in examples thread-safe.

Chore

  • Asio-grpc is now available on conan-center!
  • Use CTest's --build-and-test command for the asio-grpc-cmake test. Also use an older version of CMake (3.16) for that test.
  • Remove GCC 9 and Clang 11 pipelines.
  • Update doctest, gRPC, gtest, libunifex and liburing in the pipelines.