You can give it a callback that you can use in combination with a threading.Event to block. http://docs.python.org/2/library/threading.html#event-objects