Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

io_context::post

(Deprecated: Use post.) Request the io_context to invoke the given handler and return immediately.

template<
    typename LegacyCompletionHandler>
auto post(
    LegacyCompletionHandler && handler);

This function is used to ask the io_context to execute the given handler, but without allowing the io_context to call the handler from inside this function.

The io_context guarantees that the handler will only be called in a thread in which the run(), run_one(), poll() or poll_one() member functions is currently being invoked.

Parameters

handler

The handler to be called. The io_context will make a copy of the handler object as required. The function signature of the handler must be:

void handler();
Remarks

This function throws an exception only if:

throws an exception.


PrevUpHomeNext