def stream_channel(channel=None): if channel: if channel in [APP.config['REDIS_OPT'][psc] for psc in APP.config['REDIS_OPT'] if psc.endswith('_pubsub')]: LOGGER.info('stream for %s requested' %(channel)) return Response( stream_with_context(RDB.browser_shout(APP.config['REDIS_OPT']['%s_pubsub' %(channel)])), direct_passthrough=True, mimetype='text/event-stream' )