def results_as_compteled()

in submitit/core/core.py [0:0]


    def results_as_compteled(self, poll_interval: tp.Union[int, float] = 1) -> tp.Iterator[asyncio.Future]:
        """awaits for all tasks results concurrently. Note that the order of results is not guaranteed to match the order
        of the tasks anymore as the earliest task coming back might not be the first one you sent.

        Returns
        -------
        an iterable of Awaitables that can be awaited on to get the earliest result available of the remaining tasks.

        Parameters
        ----------
        poll_interval: int or float
            how often to check if the result is available, in seconds

        (see https://docs.python.org/3/library/asyncio-task.html#asyncio.as_completed)
        """
        if self.job.num_tasks > 1:
            yield from asyncio.as_completed(
                [self.job.task(i).awaitable().result(poll_interval) for i in range(self.job.num_tasks)]
            )

        # there is only one result anyway, let's just use async result
        yield asyncio.ensure_future(self.result())