예제 #1
0
def consume_danmaku(sock, danmaku_queue, is_health):
    """Consume danmakus.

    :param sock: the socket object.
    :param danmaku_queue: the queue to recieve danmaku.
    :param is_health: the status of connection
    """
    while True:
        danmaku = get_danmaku(danmaku_queue)
        print danmaku
        produce_danmaku.switch(sock, danmaku_queue, is_health)
예제 #2
0
def consume_danmaku(sock, danmaku_queue, is_health):
    """Consume danmakus.

    :param sock: the socket object.
    :param danmaku_queue: the queue to recieve danmaku.
    :param is_health: the status of connection
    """
    while True:
        danmaku = get_danmaku(danmaku_queue)
        try:
            print danmaku
        except TypeError:
            pass  # 测试过这玩意返回 NoneType 的时候b站直播间也不行
        produce_danmaku.switch(sock, danmaku_queue, is_health)
예제 #3
0
def consume_danmaku(sock, danmaku_queue, is_health):
    """Consume danmakus.

    :param sock: the socket object.
    :param danmaku_queue: the queue to recieve danmaku.
    :param is_health: the status of connection
    """
    while True:
        danmaku = get_danmaku(danmaku_queue)
        try:
            print danmaku
        except TypeError:
            pass # 测试过这玩意返回 NoneType 的时候b站直播间也不行
        produce_danmaku.switch(sock, danmaku_queue, is_health)