'Store the exception. Wake up the waiters.'

def set_exception(self, exception):

    with self._condition:
        self._exception = exception
        for callback in self._callbacks:
            self._handler.completion_queue.put((lambda : callback(self)))
        self._condition.notify_all()
