def async_join()

in iopath/common/file_io.py [0:0]


    def async_join(self, *paths: str, **kwargs: Any) -> bool:
        """
        Ensures that desired async write threads are properly joined.

        Usage:
            Wait for asynchronous methods operating on specific file paths to
            complete.
                async_join("path/to/file1.txt")
                async_join("path/to/file2.txt", "path/to/file3.txt")
            Wait for all asynchronous methods to complete.
                async_join()

        Args:
            *paths (str): Pass in any number of file paths and `async_join` will wait
                until all asynchronous activity for those paths is complete. If no
                paths are passed in, then `async_join` will wait until all asynchronous
                jobs are complete.

        Returns:
            status (bool): True on success
        """
        success = True
        if not paths:  # Join all.
            for handler in self._async_handlers:
                success = handler._async_join(**kwargs) and success
        else:  # Join specific paths.
            for path in paths:
                success = (
                    self.__get_path_handler(path)._async_join(path, **kwargs)
                    and success
                )
        return success