boost::corosio::basic_io_context::run_one_for

Process at most one work item for the specified duration.

Synopsis

template<
    class Rep,
    class Period>
std::size_t
run_one_for(std::chrono::duration<Rep, Period> const& rel_time);

Description

This function blocks until one work item has been executed, the specified duration has elapsed, or stop() is called. The context is stopped when there is no more outstanding work.

The context must be restarted with restart() before calling this function again after it returns.

Return Value

The number of handlers executed (0 or 1).

Parameters

Name Description

rel_time

The duration for which the call may block.

Created with MrDocs