def add_done_callback(self, fn):
        with self._condition:
            if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
                self._done_callbacks.append(fn)
                return
        fn(self)
Attaches a callable that will be called when the future finishes.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/concurrent/concurrent/futures/_base.py/Future.add_done_callback