|
ravel
Deterministic simulation testing for C++. Seed a bug, replay it exact.
|
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. | |
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.
|
inlinenoexcept |
True once the coroutine ran to completion or threw.
An empty Task counts as done.