Ejemplo n.º 1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
from redis_common import RedisHelper

obj = RedisHelper()
redis_sub = obj.subscribe()

while True:
    msg = redis_sub.parse_response()  # 此时一直阻塞状态,直到能接收到数据,
    print(msg)
Ejemplo n.º 2
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
from redis_common import RedisHelper

obj = RedisHelper()
obj.public("hello")
Ejemplo n.º 3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
from redis_common import RedisHelper

obj = RedisHelper()
obj.public('hello')  # 发布一条消息到频道fm104.5