cutelyst 5.0.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::CoroContext Class Reference

The CoroContext class. More...

#include <CoroContext.h>

Classes

struct  promise_type
 

Detailed Description

This is a VOID coroutine context aimed at making coroutine usage in Cutelyst safe.

When used in a QObject subclass method the call co_yield context; is done automatically. Otherwise when entering the coroutine body one must call co_yield context; This replaces the need for ASync if only coroutines are used. When in doubt co_yield context; will still work even if we are already tracking it.

In the case of client disconnect Cutelyst::Context destroy() signal is emitted and destroys this coroutine, making sure no use after free happens.

Definition at line 35 of file CoroContext.h.