From d4ceaf717ae4be72189cd15b5563069b7c220df7 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Tue, 24 Mar 2009 22:17:04 +0000 Subject: Add gio.AsyncResult in docs. 2009-03-24 Gian Mario Tagliaretti * docs/Makefile.am: * docs/reference/pygio-classes.xml: * docs/reference/pygio-asyncresult.xml: Add gio.AsyncResult in docs. svn path=/trunk/; revision=1032 --- docs/reference/ChangeLog | 6 ++ docs/reference/pygio-asyncresult.xml | 117 +++++++++++++++++++++++++++++++++++ docs/reference/pygio-classes.xml | 1 + 3 files changed, 124 insertions(+) create mode 100644 docs/reference/pygio-asyncresult.xml (limited to 'docs/reference') diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index e65dea5..50a7724 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2009-03-24 Gian Mario Tagliaretti + + * docs/Makefile.am: + * docs/reference/pygio-classes.xml: + * docs/reference/pygio-asyncresult.xml: Add gio.AsyncResult in docs. + 2009-03-24 Gian Mario Tagliaretti * docs/Makefile.am: diff --git a/docs/reference/pygio-asyncresult.xml b/docs/reference/pygio-asyncresult.xml new file mode 100644 index 0000000..abe56ce --- /dev/null +++ b/docs/reference/pygio-asyncresult.xml @@ -0,0 +1,117 @@ + + + + + + gio.AsyncResult + Asynchronous Function Results. + + + + Synopsis + + + gio.AsyncResult + gobject.GInterface + + + get_source_object + + + + + + + + + Ancestry + ++-- gobject.GInterface + +-- gio.AsyncResult + + + + + + Prerequisites + + gio.AsyncResult is required by + gobject.GObject. + + + + + Known Implementation + + gio.AsyncResult is implemented by + gio.SimpleAsyncResult. + + + + + Description + + + gio.AsyncResult + provides a base class for implementing asynchronous function results. + + + Asynchronous operations are broken up into two separate operations which are chained + together by a GAsyncReadyCallback. To begin an asynchronous operation, provide a + GAsyncReadyCallback to the asynchronous function. This callback will be triggered when + the operation has completed, and will be passed a GAsyncResult instance filled with the + details of the operation's success or failure, the object the asynchronous function was + started for and any error codes returned. The asynchronous callback function is then expected + to call the corresponding "_finish()" function with the object the function was called for, + and the gio.AsyncResult + instance, and optionally, an error to grab any error conditions that may have occurred. + + + The purpose of the "_finish()" function is to take the generic result of type GAsyncResult and + return the specific result that the operation in question yields (e.g. a + gio.FileEnumerator + for a "enumerate children" operation). If the result or error status of the operation is not needed, + there is no need to call the "_finish()" function, GIO will take care of cleaning up the result and error + information after the GAsyncReadyCallback returns. It is also allowed to take a reference to the + gio.AsyncResult + and call "_finish()" later. + + + The callback for an asynchronous operation is called only once, and is always called, even + in the case of a cancelled operation. On cancellation the result is a gio.ERROR_CANCELLED error. + + + Some ascynchronous operations are implemented using synchronous calls. These are run in a + separate thread, if GThread has been initialized, but otherwise they are sent to the Main Event + Loop and processed in an idle function. So, if you truly need asynchronous operations, make + sure to initialize GThread. + + + + + Methods + + + gio.AsyncResult.get_source_object + + + get_source_object + + + + + + Returns : + the source object for the res. + + + + + + The get_source_object() method gets the source object + from a gio.AsyncResult + + + + diff --git a/docs/reference/pygio-classes.xml b/docs/reference/pygio-classes.xml index b3ecda5..f401bf9 100644 --- a/docs/reference/pygio-classes.xml +++ b/docs/reference/pygio-classes.xml @@ -9,6 +9,7 @@ + -- cgit