ravel
Deterministic simulation testing for C++. Seed a bug, replay it exact.
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ravel::Task Class Reference

The coroutine type for simulated tasks. More...

#include <task.hpp>

Classes

struct  promise_type
 

Public Member Functions

 Task (Task &&other) noexcept
 Tasks are move-only: a Task owns its coroutine.
 
Task & operator= (Task &&other) noexcept
 Tasks are move-only: a Task owns its coroutine.
 
 Task (const Task &)=delete
 
Task & operator= (const Task &)=delete
 
bool done () const noexcept
 True once the coroutine ran to completion or threw.
 
void resume ()
 Runs the coroutine to its next suspension point.
 
std::exception_ptr exception () const noexcept
 The exception that escaped the coroutine body, if any.
 

Detailed Description

The coroutine type for simulated tasks.

A task starts suspended and runs only when the Scheduler resumes it; every co_await inside it is a point where the Scheduler may switch to another task.

ravel::Task worker(ravel::Scheduler& scheduler) { co_await scheduler.sleep(10); ... }

Task is move-only and owns its coroutine frame.

Member Function Documentation

◆ done()

bool ravel::Task::done ( ) const
inlinenoexcept

True once the coroutine ran to completion or threw.

An empty Task counts as done.


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