code: def _do_callbacks(self):
          
          self._done = False
  
          while self._callbacks and not self._cancelled:
              cb, eb, cb_args, cb_kwargs, eb_args, eb_kwargs = self._callbacks.pop()
              if cb and not self._exception:
                  try:
                      self._result = cb(self._result, *cb_args, **cb_kwargs)
                      self._exception = False
                  except Exception as e:
                      #logger.exception('deferred got exception while doing callback')
                      self._exception = True
                      self._result = e
                      self._tb_info = ''.join(traceback.format_tb(sys.exc_info()[2]))
              elif eb and self._exception:
                  try:
                      self._result = eb(self._result, *eb_args, **eb_kwargs)
                      self._exception = False
                  except Exception as e:
                      #logger.exception('deferred got exception while doing callback')
                      self._exception = True
                      self._result = e
                      self._tb_info = ''.join(traceback.format_tb(sys.exc_info()[2]))
  
  
          if self._exception:
              if Deferred.warnings:
                  logger.warn('Unhandled Exception: ' + str(self._result))
              self._last_exception.exception = self._result
              self._last_exception.tb_info = self._tb_info
          else:
              self._last_exception.exception = None
              self._last_exception.tb_info = None
  
          self._done = True
docs: Perform the callbacks.