Function async_func

Synopsis

#include <lib/inc/drogon/utils/coroutine.h>

template <typename Coro>
std::function< void()> async_func(Coro &&coro)

Description

returns a function that calls a coroutine

Parameters

Coro - A coroutine that is awaitable

Mentioned in

Source

Lines 733-739 in lib/inc/drogon/utils/coroutine.h.

template <typename Coro>
std::function<void()> async_func(Coro &&coro)
{
    return [coro = std::forward<Coro>(coro)]() mutable {
        async_run(std::move(coro));
    };
}





Add Discussion as Guest

Log in