asio-grpc v3.3.0
Asynchronous gRPC with Asio/unified executors
|
GrpcContext's executor. More...
#include <agrpc/grpc_executor.hpp>
Public Types | |
using | allocator_type = Allocator |
The associated allocator type. | |
Public Member Functions | |
BasicGrpcExecutor ()=default | |
Default construct an executor. | |
constexpr agrpc::GrpcContext & | context () const noexcept |
Get the underlying GrpcContext. | |
constexpr allocator_type | get_allocator () const noexcept |
Get the associated allocator. | |
bool | running_in_this_thread () const noexcept |
Determine whether the GrpcContext is running in the current thread. | |
void | on_work_started () const noexcept |
Signal the GrpcContext that an asynchronous operation is in progress. | |
void | on_work_finished () const noexcept |
Signal the GrpcContext that an asynchronous operation has completed. | |
template<class Function , class OtherAllocator > | |
void | dispatch (Function &&function, const OtherAllocator &other_allocator) const |
Request the GrpcContext to invoke the given function object. | |
template<class Function , class OtherAllocator > | |
void | post (Function &&function, const OtherAllocator &other_allocator) const |
Request the GrpcContext to invoke the given function object. | |
template<class Function , class OtherAllocator > | |
void | defer (Function &&function, const OtherAllocator &other_allocator) const |
Request the GrpcContext to invoke the given function object. | |
template<class Function > | |
void | execute (Function &&function) const |
Request the GrpcContext to invoke the given function object. | |
detail::ScheduleSender | schedule () const noexcept |
Create a Sender that completes on the GrpcContext. | |
constexpr auto | require (asio::execution::blocking_t::possibly_t) const noexcept -> agrpc::BasicGrpcExecutor< Allocator, detail::set_blocking_never(Options, false)> |
Obtain an executor with the blocking.possibly property. | |
constexpr auto | require (asio::execution::blocking_t::never_t) const noexcept -> agrpc::BasicGrpcExecutor< Allocator, detail::set_blocking_never(Options, true)> |
Obtain an executor with the blocking.never property. | |
constexpr auto | prefer (asio::execution::relationship_t::fork_t) const noexcept |
Obtain an executor with the relationship.fork property. | |
constexpr auto | prefer (asio::execution::relationship_t::continuation_t) const noexcept |
Obtain an executor with the relationship.continuation property. | |
constexpr auto | require (asio::execution::outstanding_work_t::tracked_t) const noexcept -> agrpc::BasicGrpcExecutor< Allocator, detail::set_outstanding_work_tracked(Options, true)> |
Obtain an executor with the outstanding_work.tracked property. | |
constexpr auto | require (asio::execution::outstanding_work_t::untracked_t) const noexcept -> agrpc::BasicGrpcExecutor< Allocator, detail::set_outstanding_work_tracked(Options, false)> |
Obtain an executor with the outstanding_work.untracked property. | |
template<class OtherAllocator > | |
constexpr auto | require (asio::execution::allocator_t< OtherAllocator > other_allocator) const noexcept -> agrpc::BasicGrpcExecutor< OtherAllocator, Options > |
Obtain an executor with the specified allocator property. | |
constexpr auto | require (asio::execution::allocator_t< void >) const noexcept -> agrpc::BasicGrpcExecutor< std::allocator< void >, Options > |
Obtain an executor with the default allocator property. | |
constexpr agrpc::GrpcContext & | query (asio::execution::context_t) const noexcept |
Query the current value of the context property. | |
template<class OtherAllocator > | |
constexpr allocator_type | query (asio::execution::allocator_t< OtherAllocator >) const noexcept |
Query the current value of the allocator property. | |
Static Public Member Functions | |
static constexpr auto | query (asio::execution::blocking_t) noexcept |
Query the current value of the blocking property. | |
static constexpr detail::QueryStaticMapping::result_type | query (asio::execution::mapping_t) noexcept |
Query the current value of the mapping property. | |
static constexpr detail::QueryStaticRelationship::result_type | query (asio::execution::relationship_t) noexcept |
Query the current value of the relationship property. | |
static constexpr auto | query (asio::execution::outstanding_work_t) noexcept |
Query the current value of the outstanding_work property. | |
Friends | |
template<std::uint32_t OtherOptions> | |
constexpr bool | operator== (const BasicGrpcExecutor &lhs, const agrpc::BasicGrpcExecutor< Allocator, OtherOptions > &rhs) noexcept |
Compare two GrpcExecutor for equality. | |
template<std::uint32_t OtherOptions> | |
constexpr bool | operator!= (const BasicGrpcExecutor &lhs, const agrpc::BasicGrpcExecutor< Allocator, OtherOptions > &rhs) noexcept |
Compare two GrpcExecutor for inequality. | |
GrpcContext's executor.
A lightweight handle to a GrpcContext. Trivially copyable if it is not tracking outstanding work.
Satisfies the Executor and Networking TS and Scheduler requirements and can therefore be used in places where Asio/libunifex expects an Executor
or Scheduler
.
|
default |
Default construct an executor.
The constructed object may not be used until it is assigned a valid executor, for example through GrpcContext::get_executor
.
|
inlinenodiscardconstexprnoexcept |
Get the underlying GrpcContext.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inlinenodiscardconstexprnoexcept |
Get the associated allocator.
Thread-safe
|
inlinenodiscardnoexcept |
Determine whether the GrpcContext is running in the current thread.
Thread-safe
|
inlinenoexcept |
Signal the GrpcContext that an asynchronous operation is in progress.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inlinenoexcept |
Signal the GrpcContext that an asynchronous operation has completed.
Once all outstanding asynchronous operations have completed the GrpcContext will go into the stopped state.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inline |
Request the GrpcContext to invoke the given function object.
Do not call this function directly, it is intended to be used by the asio::dispatch free function.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inline |
Request the GrpcContext to invoke the given function object.
Do not call this function directly, it is intended to be used by the asio::post free function.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inline |
Request the GrpcContext to invoke the given function object.
Do not call this function directly, it is intended to be used by the asio::defer free function.
Thread-safe
Since 1.6.0 this function is hidden when (BOOST_)ASIO_NO_TS_EXECUTORS
is defined.
|
inline |
Request the GrpcContext to invoke the given function object.
Thread-safe
|
inlinenodiscardnoexcept |
Create a Sender that completes on the GrpcContext.
Do not call this function directly. It is intended to be used by the unifex::schedule customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the blocking.possibly property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the blocking.never property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the relationship.fork property.
The GrpcExecutor always forks.
Do not call this function directly. It is intended to be used by the asio::prefer customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the relationship.continuation property.
The GrpcExecutor does not support continuation.
Do not call this function directly. It is intended to be used by the asio::prefer customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the outstanding_work.tracked property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the outstanding_work.untracked property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the specified allocator property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Obtain an executor with the default allocator property.
Do not call this function directly. It is intended to be used by the asio::require customisation point.
Thread-safe
|
inlinestaticnodiscardconstexprnoexcept |
Query the current value of the blocking property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
inlinestaticnodiscardconstexprnoexcept |
Query the current value of the mapping property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Query the current value of the context property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
inlinestaticnodiscardconstexprnoexcept |
Query the current value of the relationship property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
inlinestaticnodiscardconstexprnoexcept |
Query the current value of the outstanding_work property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
inlinenodiscardconstexprnoexcept |
Query the current value of the allocator property.
Do not call this function directly. It is intended to be used by the asio::query customisation point.
Thread-safe
|
friend |
Compare two GrpcExecutor for equality.
Returns true if the two executors can be interchanged with identical effects.
Thread-safe
|
friend |
Compare two GrpcExecutor for inequality.
Returns true if interchanging the two executors may not lead to identical effects.
Thread-safe