uvco 0.1
|
#include <loop.h>
Public Member Functions | |
Loop (Scheduler::RunMode mode=Scheduler::RunMode::Deferred) | |
Loop (const Loop &)=delete | |
Loop (Loop &&)=delete | |
Loop & | operator= (const Loop &)=delete |
Loop & | operator= (Loop &&)=delete |
~Loop () | |
uv_loop_t * | uvloop () const |
Get a non-owned pointer to the loop. | |
Static Public Member Functions | |
static void | enqueue (std::coroutine_handle<> handle) |
Private Member Functions | |
void | run () |
void | runOne () |
Static Private Member Functions | |
static Scheduler & | currentScheduler () |
Private Attributes | |
std::unique_ptr< uv_loop_t > | loop_ |
std::unique_ptr< Scheduler > | scheduler_ |
Static Private Attributes | |
static Loop * | defaultLoop = nullptr |
Friends | |
void | runLoop (Loop &) |
Not used by user code! Use runMain()
for the top-level interface.
A wrapper around a libuv event loop. uvloop()
returns a reference to the loop, and run()
starts the event loop. enqueue()
schedules a coroutine to run on the default loop at a later time, enabling any part of uvco to easily schedule work on the current loop.
Typically this is only used by uvco's internal machinery. User code will pass around a reference to the loop.
|
explicit |
|
delete |
|
delete |
uvco::Loop::~Loop | ( | ) |
|
staticprivate |
|
static |
|
private |
Run the event loop. This will serve all promises initialized before calling it.
|
private |
uv_loop_t * uvco::Loop::uvloop | ( | ) | const |
Get a non-owned pointer to the loop.
|
friend |
|
staticprivate |
|
private |
|
private |