This is a quick demonstration of how to implement a D-Bus method in Python using asynchronous callbacks.
I recently added support in system-config-printer for determining the best driver to use for a particular printer. This is an expensive operation, largely because of the time it takes to get a list of available drivers from CUPS, and the Python program providing the D-Bus service also provides other services. I wanted the program to be able to deal with other callers while the CUPS operation was in progress. Here’s how that was done.