code: def add_callbacks(self, future, callback, errback):
          
          def done(f):
              try:
                  res = f.result()
                  if callback:
                      callback(res)
              except Exception:
                  if errback:
                      errback(create_failure())
          return future.add_done_callback(done)
docs: callback or errback may be None, but at least one must be
          non-None.