Now await did like this
void rr_await(rr_context *c){ while (uv_run(c->handle->loop, UV_RUN_ONCE) && c->ok==0); } We check the flag in the variable every loop. rr_context - a structure with pointers to everything you need in the process.
Is there a standard option in order to wait for the asynchronous function to complete? If a competitive event immediately triggers a procedure that waits for an answer - will there be problems with variables on the stack or will it all be announced on the heap?
rr_awaitmultiple times for one context, almost everything will probably go to hell ... you should probably use other synchronization primitives; which ones depend on the details of the task, in this case the minimum reproducible example for experiments will not interfere. - Fat-Zerawait"om, as a paradigm, this way IMHO has nothing to do because it blocks the calling code, i.e. is the usual expectation of some event with an event-loop ... although maybe I just don't understand exactly how you use it ... about the danger - again, not knowing exactly how you use it, it is difficult to evaluate, but in my view, it will almost certainly freeze under certain actions ... - Fat-Zer