asio-grpc v1.6.0
Asynchronous gRPC with Asio/unified executors
|
The free functions in this library (except agrpc::repeatedly_request
) require that the completion handler executor be created from a agrpc::GrpcExecutor
and they use that as the I/O executor. Unlike Asio, where the I/O executor is obtained from the first argument to the initiating function. Example:
In asio-grpc:
As a consequence, asynchronous operations in asio-grpc always complete in the thread that called GrpcContext::run()/poll()
, whereas Asio would submit the completion handler for execution as if by performing asio::dispatch(exec2, [=<moved>]() { completion_handler(args...); })
. See also Asio's documentation.
Please open a ticket if you would like to have a wrapper class in asio-grpc that mimics that behavior, it is rather easy to implement.
Until asio-grpc v1.8.0 the completion handler's allocator was retrieved in a manner equivalent to:
Since v1.8.0 the allocator is retrieved using:
And for agrpc::repeatedly_request
using: