#include <Pt/Coroutine.h>
Specializes BasicAwaiter for awaitables without a result.
More...
Inherits Awaiter, and Awaiter.
Inherited by AsyncWait.
|
|
void | await_resume () |
| | Resumes the coroutine after the operation completed.
|
|
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.
|
|
bool | await_ready () const |
| | Returns false so co_await always suspends.
|
|
bool | await_suspend (std::coroutine_handle< P > h) |
| | Starts the operation and suspends the coroutine.
|
|
void | cancel () override |
| | Cancels the in-flight operation.
|
|
| virtual void | onReady ()=0 |
| | Finalizes the operation when the awaitable resumes.
|
| void | setReady () |
| | Resumes the waiting coroutine.
|
| virtual void | onBegin ()=0 |
| | Starts the asynchronous operation.
|
| virtual void | onCancel ()=0 |
| | Aborts the in-flight operation.
|
| void | setReady () |
| | Resumes the waiting coroutine.
|
| virtual void | onBegin ()=0 |
| | Starts the asynchronous operation.
|
| virtual void | onCancel ()=0 |
| | Aborts the in-flight operation.
|
Use this when the operation completes without producing a value. Implement BasicAwaiter::onReady() to finalize or clean up.
◆ onReady()
Called exactly once when the coroutine is resumed.
◆ setReady() [1/2]
Call this when the asynchronous operation has completed. Typically connect a completion signal to this method.
◆ onBegin() [1/2]
|
|
protectedpure virtualinherited |
Subscribe to completion and begin the work. The coroutine remains suspended until Awaiter::setReady() is called.
Implemented in AsyncYield.
◆ onCancel() [1/2]
|
|
protectedpure virtualinherited |
◆ setReady() [2/2]
Call this when the asynchronous operation has completed. Typically connect a completion signal to this method.
◆ onBegin() [2/2]
Subscribe to completion and begin the work. The coroutine remains suspended until Awaiter::setReady() is called.
◆ onCancel() [2/2]
| virtual void onCancel |
( |
| ) |
|
|
protectedpure virtual |
Called from Awaiter::cancel() when the waiting task or generator is cancelled.