Skip to content

Releases: Tradias/asio-grpc

v1.7.0

06 Jun 14:49
Compare
Choose a tag to compare

Features

  • Add overloads to agrpc::request and agrpc::repeatedly_request for generic RPCs.
  • Add overload to agrpc::request for starting a client-side unary request. The last argument to this function is a agrpc::GrpcContext instead of a CompletionToken because the function completes immediately.
  • Add overloads to RPC functions for -Interface versions of stub/service/reader/writer/reader_writer/response_writer.
  • Add agrpc::GrpcContext.run_completion_queue()/poll_completion_queue() which only process events from the grpc::CompletionQueue. They can be used as a better performing alternative to run()/poll() where the GrpcContext is not used as an Asio execution context.
  • RPC functions now automatically unwrap std::unique_ptr. (Except stubs which will be addressed in the next release)
  • Stabilize API of agrpc::CancelSafe. Compared to the previous release it now takes a completion signature as template argument, example: Change agrpc::CancelSafe<bool> to agrpc::CancelSafe<void(bool)>
  • (experimental) Add agrpc::GrpcStream, an IoObject-like class for handling RPCs in a cancellation safe manner. See the new handle_topic_subscription example on how it can be used to write Golang/Rust select-style code.
  • (experimental) Replace agrpc::PollContext with a more optimized free function agrpc::run that can be used to run an asio::io_context and agrpc::GrpcContext in the same thread.
  • (experimental) Add utility function to manually process gRPC tags, useful for writing mocked stubs.

Style

  • Use C++20 concepts when available to potentially improve compile times.
  • Implement several small compile time improvements.

Documentation

  • Move doxygen documentation to the gh-pages branch.

Chore

  • Add pipeline for gRPC 1.16.1.
  • Use CMake version 3.16.3 for the CMake install test.
  • Add CMake option to fallback to pkg-config when a dependency cannot be found. This option is for maintainers.
  • Add GTest to vcpkg dependencies.

v1.6.0

27 Apr 07:41
Compare
Choose a tag to compare

Features

  • (experimental) Add agrpc::CancelSafe, a utility to make RPC step functions compatible with Asio's cancellation mechanism.
  • agrpc::PollContext now uses a configurable backoff to avoid wasting CPU resources during GrpcContext idle time.
  • agrpc::GrpcContext::run and poll now return a boolean indicating whether at least one operation has been processed.
  • Add .natvis file. It is automatically added to the interface sources of asio-grpc when using the Visual Studio generator. In VSCode it should be added manually to the "visualizerFile" field in launch.json.
  • Defining (BOOST_)ASIO_NO_TS_EXECUTORS now hides members functions of the agrpc::GrpcExecutor related to Networking TS executors: context(), on_work_started(), on_work_finished(), dispatch(), defer() and post().
  • Deprecated: If a completion handler does not have an associated allocator then asio-grpc retrieves one from the associated executor's allocator property. This behavior will be removed in v1.8.0. Please use agrpc::bind_allocator(allocator, completion_token) or asio::bind_allocator instead.

Fixes

  • Defining (BOOST_)ASIO_HAS_DEDUCED_XXX_TRAIT macros is no longer required when compiling with MSVC in C++17.
  • Using polymorphic_allocator as the associated allocator of the completion handler passed to agrpc::repeatedly_request did not compile in C++20. Likewise, using std::allocator_traits<polymorphic_allocator>::construct would propagate the allocator to the constructor of agrpc::GrpcContext, agrpc::GrpcExecutor and agrpc::AllocatorBinder which was rather unexpected.
  • The comparison operator of agrpc::GrpcExecutor would not compile on older compilers if the allocator is not comparable, e.g. because it is std::allocator<void>.
  • Always return relationship::fork when querying a agrpc::GrpcExecutor for its relationship since that is the only supported setting. Preferring a different relationship property from the executor now returns the executor unchanged.

Performance

  • The client-side request convenience overloads now also perform unbinding of associated characteristics to reduce memory allocation size.
  • Also unbind asio::allocator_binder when using Boost.Asio 1.79.0 or Asio 1.22.1.

Style

  • Including agrpc/grpcContext.hpp now only provides forward declarations of the GrpcContext and its member functions. If you experience use of undefined function issues then add an include to agrpc/grpcExecutor.hpp.
  • No longer open the Asio namespace to specialize class templates.
  • Remove unused header <variant>.

Documentation

  • Document Per-Operation Cancellation properties of all asynchronous functions.
  • Document differences in the behavior of asynchronous operations compared to Asio.
  • Make examples more readable by visually separating individual sub-examples.

Chore

  • Asio-grpc is now available through the Hunter package manager!
  • Add GCC 8.4.0 to Github Actions.
  • Add CMake target to run -fsyntax-only//Zs on public header files and build that target as part of Github Actions.
  • Update Boost to 1.79.0.

v1.5.1

29 Mar 08:24
Compare
Choose a tag to compare

Fixes

  • Incorrect work counting of agrpc::repeatedly_request with awaitable which could lead to an early stop of an agrpc::GrpcContext or crash during destruction.

v1.5.0

28 Mar 17:20
Compare
Choose a tag to compare

Features

  • Add agrpc::bind_allocator which associates an allocator to a completion token's completion handler. Similar to the new asio::bind_allocator except that it also works in older versions of Asio and provides empty class optimization on the allocator.
  • Add agrpc::GrpcContext.poll() which processes only completed handler.
  • Adjust the behavior of a stopped agrpc::GrpcContext to mimic that of asio::io_context. Operations submitted to a stopped context will no longer be discarded and instead processed the next time run() or poll() is called.
  • (experimental) Add agrpc::PollContext which repeatedly polls a agrpc::GrpcContext within a different execution context. An example showing how this can be used to run an asio::io_context and agrpc::GrpcContext on the same thread has been added as well.

Fixes

  • Certain headers did not work without also including other headers.

Performance

  • Executor binder, allocator binder and cancellation slot binder are now unbound from completion handlers in RPC functions, thereby reducing the memory allocation size.
  • Avoid one dynamic memory allocation per request in agrpc::repeatedly_request with awaitable.

Style

  • Remove deprecated agrpc::use_scheduler.

Documentation

  • Add example that shows how to process a bidirectional stream by dispatching work to a thread_pool.
  • Add example that performs double-buffered, allocation-free file transfer using gRPC and io_uring.
  • Update doxygen-awesome to 2.0.2.

Chore

  • Run msvc-code-analysis alongside CodeQL every week.
  • Update vcpkg and use manifest mode and CMake presets in github actions. Also compile dependencies in release only.
  • Add several /Zc flags when compiling with MSVC to make it more C++-standard compliant.

v1.4.0

25 Feb 14:16
Compare
Choose a tag to compare

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: #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.

v1.3.1

12 Nov 10:56
Compare
Choose a tag to compare

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

v1.3.0

08 Nov 17:15
Compare
Choose a tag to compare

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

v1.2.0

30 Oct 14:14
Compare
Choose a tag to compare

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.

v1.1.2

09 Oct 09:56
Compare
Choose a tag to compare

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.

v1.1.1

08 Oct 16:10
Compare
Choose a tag to compare

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.