Struct AsyncTask

Synopsis

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

struct AsyncTask final

Description

Fires a coroutine and doesn't force waiting nor deallocates upon promise destructs

Structures

promise_type

Methods

AsyncTask

Source

Lines 378-414 in lib/inc/drogon/utils/coroutine.h.

struct AsyncTask final
{
    struct promise_type final
    {
        auto initial_suspend() noexcept
        {
            return std::suspend_never{};
        }

        auto final_suspend() noexcept
        {
            return std::suspend_never{};
        }

        void return_void() noexcept
        {
        }

        void unhandled_exception()
        {
            std::terminate();
        }

        promise_type *get_return_object() noexcept
        {
            return this;
        }

        void result()
        {
        }
    };
    AsyncTask(const promise_type *) noexcept
    {
        // the type truncates all given info about its frame
    }
};





Add Discussion as Guest

Log in