tasks.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:toshi-services-lib 作者: toshiapp 项目源码 文件源码
def __init__(self, handlers, application, queue=None, ioloop=None, listener_id=None):
        """
        handlers: list of TaskHandler classes
        application: a toshi.web.Application
        queue: the name of the subscribe channel to use for the tasks
        """

        if queue is None:
            queue = TASK_QUEUE_CHANNEL_NAME
        self.listener_id = listener_id

        self.application = application

        self.ioloop = ioloop or tornado.ioloop.IOLoop.current()
        self.queue_name = queue
        self._task_handlers = {}
        for handler, *optionals in handlers:
            if optionals:
                optionals = optionals[0]
            else:
                optionals = None
            self.add_task_handler(handler, optionals)
        self._tasks = {}
        self._running_tasks = {}
        self._shutdown_task_dispatch = False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号