Beispiel #1
0
    def test_async_task(self):
        with schema_context('testone'):
            task_id = QUtilities.add_async_task(
                'core.tasks.print_users_in_tenant')
            print(QUtilities.fetch_task(task_id))

        with schema_context('testtwo'):
            task_id = QUtilities.add_async_task(
                'core.tasks.print_users_in_tenant')
            print(QUtilities.fetch_task(task_id))
 def fetch(self, wait=0):
     """
     get the task result objects.
     :param int wait: how many milliseconds to wait for a result
     :return: an unsorted list of task objects
     """
     if self.started:
         return QUtilities.fetch_task(self.id,
                                      wait=wait,
                                      cached=self.cached)
    def fetch(self, wait=0):

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