|
uvco 0.1
|
Concepts | |
| concept | uvco::MainFunction |
Functions | |
| template<typename R, MainFunction< R > F> | |
| R | uvco::runMain (F main) |
| R uvco::runMain | ( | F | main | ) |
Set up event loop, then run main function to set up promises. Finally, clean up once the event loop has finished. An exception thrown within a coroutine is rethrown here.
MainFunction is a function taking a single const Loop& argument, and returning a Promise<R>. The supplied Loop is necessary to instantiate different types of resources, such as TCP streams or timers.
Example: