AsyncClosure provides a simple way to run an asynchronous function synchronously without blocking a running MainLoop or using threads.
1) Create an AsyncClosure with e_async_closure_new
.
2) Call the asynchronous function passing e_async_closure_callback
as the TaskReadyCallback
argument and the AsyncClosure as the data argument.
3) Call e_async_closure_wait
and collect the AsyncResult.
4) Call the corresponding asynchronous "finish" function, passing the AsyncResult returned by
e_async_closure_wait
.
5) If needed, repeat steps 2-4 for additional asynchronous functions using the same AsyncClosure.
6) Finally, free the AsyncClosure with e_async_closure_free
.