code: def set_callback(self, method, extra=None):
          
          self.__callback = method
          self.__extra = extra
          if self._done_event.is_set():
              # The execution has already finished
              self.__notify()
docs: Sets a callback method, called once the result has been computed or in
          case of exception.
  
          The callback method must have the following signature:
          ``callback(result, exception, extra)``.
  
          :param method: The method to call back in the end of the execution
          :param extra: Extra parameter to be given to the callback method