async_router_req_client.py 文件源码

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

项目:mercury 作者: jr0d 项目源码 文件源码
def get_ctx_and_connect_req_socket(zmq_url):
    """Creates a ZMQ context and a REQ socket.

    :param zmq_url: URL for the socket to connect to.
    :returns: A tuple containing the ZMQ context and the socket.
    """
    ctx = zmq.asyncio.Context()
    # noinspection PyUnresolvedReferences
    socket = ctx.socket(zmq.REQ)
    log.debug('Connection to: {}'.format(zmq_url))
    socket.connect(zmq_url)

    return ctx, socket
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号