asio-grpc

Asynchronous gRPC with Asio/unified executors

APACHE-2.0 License

Stars
321

Bot releases are visible (Hide)

asio-grpc - v1.4.0

Published by Tradias over 2 years ago

Features

  • Upcoming breaking change: agrpc::use_scheduler has been renamed to agrpc::use_sender. The old version will be removed in v1.5.0.
  • Stabilize agrpc::repeatedly_request's API. It now supports CancellationSlot/StopToken, asio::awaitable, Sender and a final CompletionToken. Also reduced the memory needed per request. See documentation and examples for more details.
  • Add agrpc::write_last which coalesces write and finish for server-side streaming RPCs and combines write and writes_done for client-side streaming RPCs.
  • Add StopToken support to agrpc::wait.
  • asio_grpc_protobuf_generate can now handle .proto files that are nested within the import directory.
  • Turn get_completion_queue into a function object.
  • Split public header files. They may now be included individually instead of only through the asioGrpc.hpp file.

Fixes

  • agrpc::wait was incorrectly using the cancellation slot of the CompletionToken instead of the CompletionHandler, leading to broken cancellation propagation.

Performance

  • Enable likely/unlikely attribute equivalents for C++17.

Style

  • Issue a static assertion when asio-grpc is used without passing it to a target_link_libraries call in CMake which can lead to hard to decipher errors: https://github.com/Tradias/asio-grpc/issues/12.
  • Move .ipp headers out of the public include directory.
  • Mark RPC functions noexcept when agrpc::use_sender is the CompletionToken.

Documentation

  • Complete API reference documentation is now available online and in code!
  • Provide an example on how to cancel individual RPC steps based on a deadline.
  • Provide documentation on how to use callbacks and stackless coroutines.
  • Fix compilation of the unifex server-streaming documentation snippets.
  • Mention that calls to find_package are needed in the As a subdirectory section of the README.
  • Update the Using vcpkg section of the README to reflect the automatic interface link library setup performed by asio-grpcConfig,cmake.

Chore

  • Avoid duplicate compilation of generated protobuf files in tests.
  • Use libc++ for Ubuntu Clang builds.
  • Enable coroutines and unifex for Clang builds.
  • Use minimum supported standalone Asio version for CI and during development.
  • Use asio separate compilation in tests.
  • Update unifex to December release.
asio-grpc - v1.3.1

Published by Tradias almost 3 years ago

Fixes

  • Add inline namespace so that libraries using different backends (Boost.Asio, standalone Asio or libunifex) can be linked together (as long as asio-grpc is not part of their public headers)

Style

  • Move GrpcSender and ScheduleSender into the detail namespace
  • Remove template parameter from UseScheduler
  • Remove unused arguments in streaming-server.cpp example
asio-grpc - v1.3.0

Published by Tradias almost 3 years ago

Features

  • Initial support for the Unified Executors proposal through libunifex and Asio
  • New special completion token created by agrpc::use_scheduler that causes an RPC step function to return a TypedSender
  • Support for standalone Asio
  • New targets: asio-grpc::asio-grpc-standalone-asio and asio-grpc::asio-grpc-unifex for the standalone Asio and libunifex based versions of this library respectively
  • The CMake package now finds and sets up linkage with dependencies. Can be disabled by setting ASIO_GRPC_DISABLE_AUTOLINK before the call to find_package(asio-grpc)
  • No longer depend on Boost.Intrusive and Boost.Lockfree

Fixes

  • Add several missing agrpc::write with grpc::WriteOptions overloads

Performance

  • Faster interaction with the GrpcContext from the thread that called .run() and even more so from other threads
  • Improved GrpcContext::run implementation

Style

  • Avoid additional, identical instantiations of RPC initiating functions for different completion tokens
  • Turn several functions into niebloids

Chore

  • Add several more examples
  • Add tests for examples
  • Reduce minimum required CMake version to 3.14 when only installing the project
asio-grpc - v1.2.0

Published by Tradias almost 3 years ago

Features

  • Provide CMake function: asio_grpc_protobuf_generate.
  • Add work tracking to all operations. This makes the behavior of GrpcContext similar to boost::asio::io_context. E.g. instead of writing
auto guard = boost::asio::make_work_guard(grpc_context);
boost::asio::post(grpc_context,
            []
            {
                guard.reset();
            });
grpc_context.run();

it is now sufficient to write:

boost::asio::post(grpc_context, [] {});
grpc_context.run();

Fixes

  • A GrpcContext is now stopped after returning from run() if there were no outstanding operations when the call was made.
  • GrpcExecutor::operator== would fail to compare executors with different execution properties.

Chore

  • Add CI pipelines for GCC 9.3.0, 11.1.0 and Clang 10.0.0, 11.0.0, 12.0.0.
  • Enable code coverage on sonarcloud.
  • Document how to shut down a gRPC server properly.
asio-grpc - v1.1.2

Published by Tradias about 3 years ago

Chore

  • Generate ASIO_GRPC_USE_BOOST_CONTAINER related header files in the build directory instead of the source directory as required by vcpkg_cmake_configure.
asio-grpc - v1.1.1

Published by Tradias about 3 years ago

Fixes

  • Small breaking change: Remove the optional second argument from the agrpc::GrpcContext constructor which would incorrectly turn a completion handler with an associated std::allocator into a completion handler that uses the specified argument for allocations. If control over the allocator is needed then resort to Boost.Asio's standard mechanisms: Associate the allocator with the completion handler or boost::asio::require the allocator from the executor.
  • Bake the choice of ASIO_GRPC_USE_BOOST_CONTAINER into the installed header files to avoid accidental mixing of libraries compiled with and without it. This behavior is also required by vcpkg.

Chore

  • Add CMake-based pre-commit hooks and CONTRIBUTING guidelines.
asio-grpc - v1.1.0

Published by Tradias about 3 years ago

Features

  • Use Boost.Container instead of <memory_resource> by setting the CMake variable ASIO_GRPC_USE_BOOST_CONTAINER
  • agrpc::wait can now be cancelled by associating a cancellation slot to the CompletionToken (Boost 1.77.0)
  • (experimental) New function agrpc::repeatedly_request. Can be used by servers to ensure that there are enough outstanding calls to request a new RPC. It takes a function object which should define how to handle an incoming RPC, it could e.g. be co_spawning a new coroutine to process it.

Fixes

  • boost::asio::require(grpc_executor, boost::asio::execution::allocator) would not compile due to calling a constructor that is explicit

Performance

  • Reduce memory allocation size of asynchronous operations that use the default allocator or where submitted from the thread that is calling agrpc::GrpcContext::run
  • Remove redundant if-condition when deallocating an asynchronous operation

Style

  • Provide better error message when attempting to use the DefaultCompletionToken without coroutines being available
  • Remove [[nodiscard]] from agrpc::request functions

Chore

  • Do not attempt to find_package or link with gRPC::grpc++ and Boost::headers when only installing the CMake project
  • Add Github build and test actions for MacOS-11 (AppleClang 12) and Windows-2022
  • Add Github action for automatically running MarkdownSnippets
  • Fix CMake unity build by excluding protobuf generated source files from it
asio-grpc - v1.0.1

Published by Tradias about 3 years ago

  • Fix compatibility with older versions of Boost that do not support awaitables when compiling with C++20
asio-grpc - v1.0.0

Published by Tradias about 3 years ago

  • ExecutionContext compatible agrpc::GrpcContext
  • Executor and Networking TS compatible agrpc::GrpcExecutor
  • Support for all types of RPC, both client-side and server-side. Including support for all (non-experimental) CompletionTokens that Boost.Asio comes with.
  • Support for waiting for a grpc::Alarm