uvco 0.1
|
Classes | |
class | uvco::MultiPromiseCore< T > |
class | uvco::Generator< T > |
class | uvco::MultiPromise< T > |
class | uvco::Coroutine< T > |
A coroutine object used internally by C++20 coroutines ("promise object"). More... | |
class | uvco::Promise< T > |
class | uvco::PromiseHandle< T > |
class | uvco::Promise< void > |
class | uvco::Coroutine< void > |
class | uvco::PromiseCore< T > |
class | uvco::PromiseCore< void > |
class | uvco::SelectSet< Ts > |
Enumerations | |
enum class | uvco::PromiseState { uvco::PromiseState::init = 0 , uvco::PromiseState::waitedOn = 1 , uvco::PromiseState::resuming = 2 , uvco::PromiseState::finished = 3 } |
|
strong |
Valid states for a promise to be in:
Initially, init
marks a newly constructed promise. Once a coroutine waits for its result, the promise transitions to waitedOn
. At that point, the handle_
field contains a resume handle (of the waiter). Once the promise is ready and the caller is resumed, the state transitions to running
. After the caller has been run (and suspended again), the state is finished
, and no more operations may be executed on this promise.
Enumerator | |
---|---|
init | After construction, as the associated coroutine is about to start, up to the first suspension point and the following co_await. |
waitedOn | After the coroutine has reached a suspension point and another coroutine has started co_awaiting it. |
resuming | After the coroutine has been resumed, and is scheduled to be run on the next Loop turn. |
finished | A coroutine has returned the value and the promise is either ready to be resolved, or has already been resolved (ready() vs stale()). |