tasks.py 文件源码

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

项目:piwheels 作者: bennuttall 项目源码 文件源码
def register(self, queue, handler, flags=zmq.POLLIN):
        """
        Register *queue* to be polled on each cycle of the task. Any messages
        with the relevant *flags* (defaults to ``POLLIN``) will trigger the
        specified *handler* method which is expected to take a single argument
        which will be *queue*.

        :param zmq.Socket queue:
            The queue to poll.

        :param handler:
            The function or method to call when a message with matching *flags*
            arrives in *queue*.

        :param int flags:
            The flags to match in the queue poller (defaults to ``POLLIN``).
        """
        self.poller.register(queue, flags)
        self.handlers[queue] = handler
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号