~sirn/fanboi2

ref: a68873a108d20a6a49a1b6caf374bfb2cf6a94fe fanboi2/fanboi2/services/task.py -rw-r--r-- 386 bytes
a68873a1Kridsada Thanabulpong Coding style cleanups and setup pre-commit hooks (#42) 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
from ..tasks import celery, ResultProxy


class TaskQueryService(object):
    """Task query service provides a service for querying a task status."""

    def result_from_uid(self, task_uid):
        """Query a task from the given task UID.

        :param task_uid: A UID :type:`str` for a task.
        """
        task = celery.AsyncResult(task_uid)
        return ResultProxy(task)