== Entry into an cobalt environment In order to use <> we need to be able to `co_await` them, i.e. be within a coroutine. We got four ways to achieve this: <
>:: replace `int main` with a coroutine [source,cpp] ---- cobalt::main co_main(int argc, char* argv[]) { // co_await things here co_return 0; } ---- <>:: create a thread for the asynchronous environments [source,cpp] ---- cobalt::thread my_thread() { // co_await things here co_return; } int main(int argc, char ** argv[]) { auto t = my_thread(); t.join(); return 0; } ---- <>:: create a task and run or spawn it [source,cpp] ---- cobalt::task my_thread() { // co_await things here co_return; } int main(int argc, char ** argv[]) { cobalt::run(my_task()); // sync asio::io_context ctx; cobalt::spawn(ctx, my_task(), asio::detached); ctx.run(); return 0; } ----