You might be able to use this that I wrote some time ago. It might need
some maintenance as the Twisted Deferred code has moved on since then. But
the approach might help you:
http://www.twistedmatrix.com/pipermail/twisted-python/2008-October/018535.html