AsyncExecute Class Reference

#include <Pt/Db/Connection.h>

Awaitable for asynchronous execute.

Inherits ConnectionAwaiter.

Public Member Functions

bool await_ready () const
 Returns false so co_await always suspends.
template<typename P>
bool await_suspend (std::coroutine_handle< P > h)
 Starts the operation and suspends the coroutine.
void cancel () override
 Cancels the in-flight operation.

Protected Member Functions

void onCancel () override
 Aborts the in-flight operation.
void setReady ()
 Resumes the waiting coroutine.

Member Function Documentation

◆ onCancel()

void onCancel ( )
overrideprotectedvirtualinherited

Called from Awaiter::cancel() when the waiting task or generator is cancelled.

Implements Awaiter.

◆ setReady()

void setReady ( )
protectedinherited

Call this when the asynchronous operation has completed. Typically connect a completion signal to this method.