def event_stream(channel=None):
    
    pubsub = msgServer.pubsub()
    pubsub.subscribe(channel)
    
    # handle client disconnection in the client side by calling the exit keyword

    try:
        for msg in pubsub.listen():
            yield 'data: %s\n\n' % msg['data']
    except Exception:
        yield 'data: NONE\n\n' #if a timeout happens on the listen, we need to return something
dataset/ETHPy150Open daeilkim/refinery/refinery/refinery/webapp/pubsub.py/event_stream/original