Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres::worker Struct Reference

Single-threaded Postgres workload worker. More...

#include <threading.hpp>

Public Member Functions

void terminate ()
 
template<typename F , typename... Args>
auto post (F &&f, Args &&...args) -> std::future< std::invoke_result_t< F, Args... > >
 
void run ()
 Run the worker.
 

Detailed Description

Single-threaded Postgres workload worker.

Warning
Use extreme caution and care when handling workload – ensure the worker does not outlive the intended lifetime – and receives no interference – that is, no other threads should be doing any Postgres workloads while this worker is alive.

Member Function Documentation

◆ run()

void cppgres::worker::run ( )
inline

Run the worker.

Exceptions
std::runtime_errorif called on a secondary thread

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