asio-grpc v3.1.0
Asynchronous gRPC with Asio/unified executors
agrpc::DefaultRunTraits Struct Reference

(experimental) Default run traits More...

#include <agrpc/run.hpp>

Static Public Member Functions

template<class ExecutionContext >
static bool poll (ExecutionContext &execution_context)
 How to poll the execution context. More...
 
template<class ExecutionContext , class Rep , class Period >
static bool run_for (ExecutionContext &execution_context, std::chrono::duration< Rep, Period > duration)
 How to run the execution context for the specified duration. More...
 
template<class ExecutionContext >
static bool is_stopped (ExecutionContext &execution_context)
 Has the execution context been stopped?
 

Static Public Attributes

static constexpr std::chrono::microseconds MAX_LATENCY {250}
 The desired maximum latency. More...
 

Detailed Description

(experimental) Default run traits

Since
1.7.0

Member Function Documentation

◆ poll()

template<class ExecutionContext >
static bool agrpc::DefaultRunTraits::poll ( ExecutionContext &  execution_context)
inlinestatic

How to poll the execution context.

This function should let the execution context process some work without sleeping and return true if any work has been processed.

◆ run_for()

template<class ExecutionContext , class Rep , class Period >
static bool agrpc::DefaultRunTraits::run_for ( ExecutionContext &  execution_context,
std::chrono::duration< Rep, Period >  duration 
)
inlinestatic

How to run the execution context for the specified duration.

This function should let the execution context process some work and sleep for at least duration. If any work has been processed then it should return true.

Member Data Documentation

◆ MAX_LATENCY

constexpr std::chrono::microseconds agrpc::DefaultRunTraits::MAX_LATENCY {250}
staticconstexpr

The desired maximum latency.

The maximum latency between consecutive polls of the execution context.