Python heapq and priority queue

Signed-off-by: apporc <appleorchard2000@gmail.com>
Twisted deferredGenerator and inlineCallbacks

Signed-off-by: apporc <appleorchard2000@gmail.com>