TelepathyQt4: Asynchronous Object Model

| Home · All Classes · All Namespaces · Modules · Functions · Files

# Asynchronous Object Model

## Overview

Telepathy-Qt4 uses D-Bus to communicate with applications implementing the Telepathy specification.

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.

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.

In order to do this new classes so called PendingOperations were created, and all methods that need to be asynchronous will return a Tp::PendingOperation which will emit a signal Tp::PendingOperation::finished() when the operation has ended. See PendingOperation documentation for more details.

So when instantiating a new object (Tp::Account, Tp::AccountManager, Tp::Connection, and so on), one needs to call Tp::ReadyObject::becomeReady() and wait the returned PendingOperation to finish before using the object.

This assures that the initial object introspection process is completed and the object is ready to use.

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.