This method is used in DagFileProcessor.process_file - it may be easier to migrate all it's internal calls instead of the whole method.
if self._done:
            return True
        if self._parent_channel.poll():
            try:
                self._result = self._parent_channel.recv()
                self._done = True
                self.log.debug("Waiting for %s", self._process)
                self._process.join()
                self._parent_channel.close()
                return True
            except EOFError:
                
                
                
                
                self._done = True
                
                self._process.join(timeout=5)
                if self._process.is_alive():
                    
                    self._kill_process()
        if not self._process.is_alive():
            self._done = True
            self.log.debug("Waiting for %s", self._process)
            self._process.join()
            self._parent_channel.close()
            return True
        return False
    @property
    def result(self) -> tuple[int, int] | None: