code: def add_callback(self, fn, *args, **kwargs):
          
          run_now = False
          with self._callback_lock:
              # Always add fn to self._callbacks, even when we're about to
              # execute it, to prevent races with functions like
              # start_fetching_next_page that reset _final_result
              self._callbacks.append((fn, args, kwargs))
              if self._final_result is not _NOT_SET:
                  run_now = True
          if run_now:
              fn(self._final_result, *args, **kwargs)
          return self
docs: Attaches a callback function to be called when the final results arrive.
  
          By default, `fn` will be called with the results as the first and only
          argument.  If `*args` or `**kwargs` are supplied, they will be passed
          through as additional positional or keyword arguments to `fn`.
  
          If an error is hit while executing the operation, a callback attached
          here will not be called.  Use :meth:`.add_errback()` or :meth:`add_callbacks()`
          if you wish to handle that case.
  
          If the final result has already been seen when this method is called,
          the callback will be called immediately (before this method returns).
  
          Note: in the case that the result is not available when the callback is added,
          the callback is executed by IO event thread. This means that the callback
          should not block or attempt further synchronous requests, because no further
          IO will be processed until the callback returns.
  
          **Important**: if the callback you attach results in an exception being
          raised, **the exception will be ignored**, so please ensure your
          callback handles all error cases that you care about.
  
          Usage example::
  
              >>> session = cluster.connect("mykeyspace")
  
              >>> def handle_results(rows, start_time, should_log=False):
              ...     if should_log:
              ...         log.info("Total time: %f", time.time() - start_time)
              ...     ...
  
              >>> future = session.execute_async("SELECT * FROM users")
              >>> future.add_callback(handle_results, time.time(), should_log=True)