25 using Service::Service;
30 template<
typename Function>
void post(
Function&& function) {
mQueue.emplace_back(std::forward<Function>(function)); }
43 asio::use_service<IdleService>(context).post(std::move(
token));
Definition ExecutionContext.hpp:96
A context for function object execution.
Definition ExecutionContext.hpp:90
A service that allows submitting work to be ran whenever the executor is going idle.
Definition IdleService.hpp:18
void poll()
Polls the service for any work.
void post(Function &&function)
Submits a new callback to be invoked.
Definition IdleService.hpp:30
List< UniqueFunction< void()> > mQueue
A list of work to be ran by the service the next time it's executor becomes idle.
Definition IdleService.hpp:22
Definition Application.hpp:19
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) idle(ExecutionContext &context
std::list< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > List
List is a container that supports constant time insertion and removal of elements from anywhere in th...
Definition List.hpp:21
FunctionBase< true, true, fu2::capacity_default, true, false, Signatures... > Function
An owning copyable function wrapper for arbitrary callable types.
Definition Function.hpp:54
ASIO_MOVE_ARG(CompletionToken) token)
Definition IdleService.hpp:42
FunctionBase< true, false, fu2::capacity_default, true, false, Signatures... > UniqueFunction
An owning non copyable function wrapper for arbitrary callable types.
Definition Function.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25