def result(self, wait=0):
     """
     return the full list of results.
     :param int wait: how many milliseconds to wait for a result
     :return: an unsorted list of results
     """
     if self.started:
         return QUtilities.get_result(self.id,
                                      wait=wait,
                                      cached=self.cached)
Ejemplo n.º 2
0
    def test_iter(self):

        broker = get_broker()
        broker.purge_queue()
        broker.cache.clear()

        numbers = [random.randrange(1, 30) * 0.75 for i in range(1, 5)]
        with schema_context('testone'):
            task_1 = QUtilities.add_async_tasks_from_iter('math.floor',
                                                          numbers,
                                                          sync=True)
            result = QUtilities.get_result(task_1)
            print(numbers, result)
            assert result is not None
            broker.cache.clear()
    def result(self, wait=0):

        if self.started:
            return QUtilities.get_result(self.id,
                                         wait=wait,
                                         cached=self.cached)