defer.utils — Utilities for defer

Utils for using deferreds with D-Bus.

D-Bus service

defer.utils.dbus_deferred_method(*args, **kwargs)

Export the decorated method on the D-Bus and handle a maybe returned Deferred.

This decorator can be applied to methods in the same way as the @dbus.service.method method, but it correctly handles the case where the method returns a Deferred.

This decorator was kindly taken from James Henstridge blog post and adopted: http://blogs.gnome.org/jamesh/2009/07/06/watching-iview-with-rygel/

D-Bus client

defer.utils.deferable(func)

Add a defer attribute to the decorated function and return a Deferred object. The callback of the Deferred will be passed as reply_handler argument and the errback as the error_handler argument to the decorated function.

This decorator allows to easily make use of Deferreds in a DBus client.

Table Of Contents

Previous topic

defer — The defer module

This Page