|
joque
task orchestration library
|
Coroutine representing one execution of entire task set. More...
#include <exec_coro.hpp>
Classes | |
| struct | promise_type |
Public Member Functions | |
| exec_coro (std::coroutine_handle< promise_type > h) | |
| Constructed by the coroutine mechanism from withing the promise type. More... | |
| exec_coro (exec_coro &&other) noexcept | |
| Move swaps internal pointers. More... | |
| exec_coro & | operator= (exec_coro &&other) noexcept |
| bool | done () const |
| Execution is done after coroutine finishes it's run. More... | |
| std::optional< exec_record > | result () |
| Returns execution record with data on successfull run. More... | |
| void | tick () |
| Runs one iteration of the execution, either new task is executed or nothing happens due to all threads/resources being utilized. More... | |
| std::optional< exec_record > | run (std::chrono::milliseconds period=std::chrono::milliseconds{ 5 }) |
Blocks until coroutine finishes it's run, returns pointer to exec_record with exact same behavior as result. More... | |
| ~exec_coro () | |
| Destroys the coroutine if any. More... | |
Coroutine representing one execution of entire task set.
| joque::exec_coro::exec_coro | ( | std::coroutine_handle< promise_type > | h | ) |
Constructed by the coroutine mechanism from withing the promise type.
|
noexcept |
Move swaps internal pointers.
| joque::exec_coro::~exec_coro | ( | ) |
Destroys the coroutine if any.
| bool joque::exec_coro::done | ( | ) | const |
Execution is done after coroutine finishes it's run.
| std::optional< exec_record > joque::exec_coro::result | ( | ) |
Returns execution record with data on successfull run.
Returns empty otherwise. If exception was raised during the run, result will rethrow it.
| void joque::exec_coro::tick | ( | ) |
Runs one iteration of the execution, either new task is executed or nothing happens due to all threads/resources being utilized.
Does nothing after the execution finished.
| std::optional< exec_record > joque::exec_coro::run | ( | std::chrono::milliseconds | period = std::chrono::milliseconds{ 5 } | ) |
Blocks until coroutine finishes it's run, returns pointer to exec_record with exact same behavior as result.
| period | Time between attempts to resume the coroutine |