core.py 文件源码

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

项目:agentzero 作者: gabrielfalcao 项目源码 文件源码
def ready(self, name, polling_mechanism, timeout=None):
        """Polls all sockets and checks if the socket with the given name is ready for either ``zmq.POLLIN`` or  ``zmq.POLLOUT``.

        returns the socket if available, or ``None``

        :param socket_name: the socket name
        :param polling_mechanism: either ``zmq.POLLIN`` or ``zmq.POLLOUT``
        :param timeout: the polling timeout in miliseconds that will
          be passed to ``zmq.Poller().poll()`` (optional, defaults to
          ``core.DEFAULT_POLLING_TIMEOUT``)

        """
        socket = self.get_by_name(name)
        available_mechanism = self.engage(timeout is None and self.timeout or timeout).pop(socket, None)
        if polling_mechanism == available_mechanism:
            return socket
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号