Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
orbit::concurrency::Task Struct Reference

Fire-and-forget coroutine type, used as the return type of coroutine route handlers. More...

#include <Task.hpp>

Classes

struct  promise_type
 

Public Member Functions

 Task (std::coroutine_handle< promise_type > h)
 

Public Attributes

std::coroutine_handle< promise_type > handle
 

Detailed Description

Fire-and-forget coroutine type, used as the return type of coroutine route handlers.

An exception that escapes the coroutine never terminates the process. In a handler — a coroutine that takes a std::shared_ptr<ResponseWriter> parameter — it is handled like an exception from a synchronous handler: the router's on_error handler runs, else the client gets a 500. Elsewhere it is logged.

A request the coroutine takes as a parameter (HttpRequest&) stays valid, headers and body included, until the coroutine finishes: across every co_await, and even after the response has been sent.

Constructor & Destructor Documentation

◆ Task()

orbit::concurrency::Task::Task ( std::coroutine_handle< promise_type >  h)
inline

Member Data Documentation

◆ handle

std::coroutine_handle<promise_type> orbit::concurrency::Task::handle

The documentation for this struct was generated from the following file: