1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>TelepathyQt4: Asynchronous Object Model</title>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="1"> </td>
<td class="postheader" valign="center">
<a href="index.html">
<font color="#004faf">Home</font></a> ·
<a href="classes.html">
<font color="#004faf">All Classes</font></a> ·
<a href="namespaces.html">
<font color="#004faf">All Namespaces</font></a> ·
<a href="modules.html">
<font color="#004faf">Modules</font></a> ·
<a href="functions.html">
<font color="#004faf">Functions</font></a> ·
<a href="files.html">
<font color="#004faf">Files</font></a>
</td>
</tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.6.3 -->
<div class="contents">
<h1><a class="anchor" id="async_model">Asynchronous Object Model </a></h1><h2><a class="anchor" id="async_model_overview">
Overview</a></h2>
<p>Telepathy-Qt4 uses <a href="http://dbus.freedesktop.org">D-Bus</a> to communicate with applications implementing the <a href="http://telepathy.freedesktop.org/spec.html">Telepathy specification</a>.</p>
<p>When dealing with D-Bus, method calls can take some time to return, and in this case is not desirable to make synchronous calls, which could turn into applications hanging waiting for method returns.</p>
<p>Telepathy-Qt4 introduces a new model in which objects needs to become ready before usage. This model became necessary as we needed a completelly asynchronous API for D-Bus proxy objects.</p>
<p>In order to do this new classes so called PendingOperations were created, and all methods that need to be asynchronous will return a <a class="el" href="classTp_1_1PendingOperation.html">Tp::PendingOperation</a> which will emit a signal <a class="el" href="classTp_1_1PendingOperation.html#addbb8c4462019ffdf19095a31da0cc7a">Tp::PendingOperation::finished()</a> when the operation has ended. See PendingOperation documentation for more details.</p>
<p>So when instantiating a new object (<a class="el" href="classTp_1_1Account.html">Tp::Account</a>, <a class="el" href="classTp_1_1AccountManager.html">Tp::AccountManager</a>, <a class="el" href="classTp_1_1Connection.html">Tp::Connection</a>, and so on), one needs to call <a class="el" href="classTp_1_1ReadyObject.html#ac02393f99a46725a4ffee32caaec13cc">Tp::ReadyObject::becomeReady()</a> and wait the returned PendingOperation to finish before using the object.</p>
<p>This assures that the initial object introspection process is completed and the object is ready to use.</p>
<p>Many objects cache the returned values of a previous introspection run for future access, allowing some methods to be synchronous. See the individual methods descriptions for more details. </p>
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright © 2008-2010 Collabora Ltd. and Nokia Corporation</td>
<td width="30%" align="right"><div align="right">Telepathy-Qt4 0.3.6</div></td>
</tr></table></div></address>
</body>
</html>
|