Skip to content

Releases: Tradias/asio-grpc

v3.4.0

15 Dec 11:17
Compare
Choose a tag to compare

Features

  • (experimental) RPC handlers passed to register_x functions may now have a member function called request_message_factory() whose return object will be used to create the initial request message in unary and server-streaming rpcs. This can be used to allocate the message in a protobuf arena (example) or reuse it between rpcs.
  • Make Asio based register_x functions compatible with GrpcContext::run_completion_queue/poll_completion_queue()
  • Cleanup asio-grpc.natvis and add support for Asio+libunifex/stdexec mixed builds.

Performance

  • Changed GrpcContext::shutdown_ from atomic to regular bool. This bool is checked at the start and end of every asynchronous operation.

Documentation

  • Add server example showing how to use an asio::io_context as the main execution context and a GrpcContext on a separate thread with GrpcContext::run_completion_queue().

v3.3.0

27 Nov 20:08
Compare
Choose a tag to compare

Features

  • (experimental) Add agrpc::register_coroutine_rpc_handler, a generic version of agrpc::register_awaitable_rpc_handler that can be used to handle RPCs with all kinds of awaitable types like asio::experimental::coro and boost::cobalt::task. This can, for example, be used to implement async generator style rpc handler:
asio::experimental::coro<const example::v1::Response*, grpc::Status> 
handle_server_streaming_request(agrpc::GrpcExecutor executor, example::v1::Request& request)
{
    example::v1::Response response;
    response.set_integer(request.integer());
    agrpc::Alarm alarm{executor};
    for (size_t i{}; i != 5; ++i)
    {
        response.set_integer(response.integer() + 1);
        co_yield &response;
        co_await alarm.wait(std::chrono::system_clock::now() + std::chrono::seconds(1));
    }
    co_return grpc::Status::OK;
}

Fixes

  • Fix compilation of health_check_service.hpp with recent gRPC versions by removing use of GPR_ASSERT macro.

Documentation

  • Code snippets now have a copy button in the top right corner.
  • Improve several links between classes/functions in the documentation.
  • Document agrpc::DefaultServerRPCTraits.
  • Fix empty documentation of agrpc::ClientRPC<GENERIC_STREAMING> and agrpc::ServerRPC<GENERIC>.

Chore

  • Replace Clang 12 build with Clang 18.
  • Update doxygen to 1.12.0 and doxygen-awesome to 2.3.4.
  • Update vcpkg, includes Boost 1.86 update.

v3.2.1

19 Oct 14:37
Compare
Choose a tag to compare

Fixes

  • Fix compilation when ASIO_USE_TS_EXECUTOR_AS_DEFAULT is defined. Note that asio::experimental::parallel_group does not seem to support it and therefore any asio-grpc example that makes use of parallel groups will not compile. Additionally, asio-grpc does not guarantee that future versions remain compatible with ASIO_USE_TS_EXECUTOR_AS_DEFAULT since this preprocessor definition is meant as a migration aid for Boost.Asio 1.73->1.74 and asio-grpc requires Boost.Asio 1.74. Please update your code so that it no longer needs the definition.

v3.2.0

14 Sep 15:50
Compare
Choose a tag to compare

Features

  • Add multi-threading support to GrpcContext's run and poll functions if the context has been constructed with one of the new constructors and the provided concurrency_hint is greater than one. Note that just like with asio::io_context you still have to call GrpcContext::run/poll from the desired numbers of threads. Also note that agrpc::HealthCheckService is incompatible with the new multi-threaded GrpcContext.
  • Add static_asserts to register_ functions that improve compilation error messages when providing an incompatible RPCHandler.
  • Add support for custom allocators that use fancy pointers.

Performance

  • The thread local memory pool will now grow up to a maximum of 127008 bytes. Allocations beyond that and individual allocations larger than 1024 byte will be served by std::allocator. Overaligned types no longer trigger a static assertion.
  • register_callback_rpc_handler now uses the user-provided allocator to wait for notify_when_done.

Documentation

  • Add gRPC client and server example that use the new multi-threaded GrpcContext.
  • Add note that only one call to ServerRPC::wait_for_done may be outstanding at a time.

Chore

  • No longer add standalone asio-grpc target when only building examples. All examples use Boost.Asio.

v3.1.0

08 Apr 15:48
Compare
Choose a tag to compare

Features

  • Prevent AGRPC_ macros from leaking into user code.
  • Add operator bool and swap to agrpc::ServerRPCPtr.

Chore

  • Update vcpkg (includes Boost 1.83->1.84 update)

v3.0.0

14 Feb 10:05
Compare
Choose a tag to compare

v3 migration guide

Features

  • De-experimentalize agrpc::ServerRPC, agrpc::ClientRPC and agrpc::register_x functions.
  • Remove several functions and classes. See migration guide for details.
  • asio-grpcConfig.cmake no longer calls find_package for all possible backends.
  • Remove support for deprecated asio::execution functions.
  • Remove deprecated ASIO_GRPC_USE_BOOST_CONTAINER and ASIO_GRPC_USE_RECYCLING_ALLOCATOR cmake options.

The agrpc::Server/ClientRPC API is not understood by Microsoft's Intellisense. If that bothers you then please react to this bug ticket.

v2.9.3

06 Feb 14:37
Compare
Choose a tag to compare

Fixes

  • InvokeHandler::YES/NO conflicts with Objective-C/C++ define YES/NO on Apple platforms.

v2.9.2

20 Jan 10:45
Compare
Choose a tag to compare

Features

  • Add support for stdexec::schedule(grpc_executor).

Fixes

  • Fix deadlock when the rpc handler passed to agrpc::register_sender_rpc_handler in stdexec returns exec::task.
  • Add missing includes for grpc::ServerAsyncX types in several places. This only lead to compilation errors in certain gRPC versions (~1.30-1.40).
  • Fix compilation of tests with Boost 1.84 due to removed header file.

Performance

  • No longer perform writes_done during finish if a previous write or read_initial_metadata ended in false in the streaming ClientRPCs.

Documentation

Chore

  • Use file(GLOB) to create check-header-syntax target to avoid forgetting to add a new header to the list.
  • Unify common parts of stdexec und unifex tests into one file.
  • Build asio-grpc-check-header-syntax target in the Ubuntu/20.04/Default pipeline.

v2.9.1

27 Dec 13:11
Compare
Choose a tag to compare

Fixes

v2.9.0

24 Dec 11:30
Compare
Choose a tag to compare

This will likely be the last release before v3. Migration guide

Features

  • Breaking change: When using sender/receiver, agrpc::Alarm will now use the set_done/set_stopped channel when cancelled, instead of sending a bool through the set_value channel.
  • Breaking change: When using asio::execution the StopToken was obtained by calling asio::get_associated_cancellation_slot on the receiver. An unstoppable token is now used instead. Note that asio::execution is deprecated and should no longer be used.
  • Asio and execution may now be used within the same application. Simply link with asio-grpc::asio-grpc(-standalone-asio) and asio-grpc::asio-grpc-(unifex|stdexec).
  • Add execution::get_scheduler support to I/O objects.
  • Mark senders [[nodiscard]].
  • Fix and improve asio-grpc.natvis. Also add support for stdexec. To learn how natvis files can improve your debugging experience check out the Visual Studio or Visual Studio Code documentation.

Fixes

  • Partially fix agrpc::Waiter.initiate for sender/receiver. Currently only the set_value channel is forwarded to the waiting operation.
  • Make agrpc::process_grpc_tag work properly with unifex/stdexec instead of silently be a no-op.
  • Use of register_yield_rpc_handler with standalone Asio 1.24.0+.
  • Conditional detection of asio::execution with Asio 1.30.0+ / Boost 1.84+.

Chore

  • Change the Boost.Asio+stdexec test to now use standalone Asio.
  • Update Boost to 1.83.0.
  • Update doxygen-awesome to 2.3.1.