Top | ![]() |
![]() |
![]() |
![]() |
CamelAsyncClosure * | camel_async_closure_new () |
|
camel_async_closure_wait () |
|
camel_async_closure_free () |
|
camel_async_closure_callback () |
CamelAsyncClosure provides a simple way to run an asynchronous function synchronously without blocking the current thread.
1) Create a CamelAsyncClosure with camel_async_closure_new()
.
2) Call the asynchronous function passing camel_async_closure_callback()
as the
3) Call camel_async_closure_wait()
and collect the
4) Call the corresponding asynchronous "finish" function, passing the
camel_async_closure_wait()
.
5) If needed, repeat steps 2-4 for additional asynchronous functions using the same CamelAsyncClosure.
6) Finally, free the CamelAsyncClosure with camel_async_closure_free()
.
CamelAsyncClosure *
camel_async_closure_new (void
);
Creates a new CamelAsyncClosure for use with asynchronous functions.
[skip]
Since: 3.12
GAsyncResult * camel_async_closure_wait (CamelAsyncClosure *closure
);
Call this function immediately after starting an asynchronous operation.
The function waits for the asynchronous operation to complete and returns
its
This function can be called repeatedly on the same CamelAsyncClosure to easily string together multiple asynchronous operations.
[skip]
Since: 3.12
void camel_async_closure_free (CamelAsyncClosure *closure
);
Frees the closure
and the resources it holds.
[skip]
Since: 3.12
void camel_async_closure_callback (,
GObject *source_object,
GAsyncResult *result);
gpointer closure
Pass this function as the
This causes camel_async_closure_wait()
to terminate and return result
.
[skip]
Since: 3.12
typedef struct _CamelAsyncClosure CamelAsyncClosure;
Contains only private data that should be read and manipulated using the functions below.
Since: 3.12