C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::CancellableTask< TaskType > Class Template Referencefinal

Overview

template<typename TaskType>
class pw::async2::CancellableTask< TaskType >

A wrapper around a Task that allows it to be gracefully cancelled. The base task (TaskType) must have a non-private, non-final DoPend.

Inheritance diagram for pw::async2::CancellableTask< TaskType >:

Public Member Functions

void Cancel ()
 

Protected Member Functions

Poll DoPend (Context &cx) final
 

Member Function Documentation

◆ Cancel()

template<typename TaskType >
void pw::async2::CancellableTask< TaskType >::Cancel ( )
inline

Cancels the task.

This operation does not immediately remove the task from the dispatcher. Instead, it wakes the task and arranges for it to complete gracefully. To confirm when the task has terminated, check IsRegistered().

If the task has already completed, this is a no-op.


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