async def execute(config): logger.debug(config) config['settings'].update(default_settings) redis_cmd = okws.RedisCommand(config['settings']['REDIS_URL'], config['settings']['REDIS_INFO_KEY']) redis = okws.Redis(config['settings']['LISTEN_CHANNEL'], redis_cmd) await asyncio.gather(redis.run(), execute_config_task(config))
async def test_cmd(): try: client = okws.Redis(CHANNELS, on_cmd) await asyncio.gather( client.run(), send_exit_cmd(client)) except asyncio.CancelledError: logger.info("catch CancelledError!!")
async def run(redis_url='redis://localhost', listen_channel='trade-ws', redis_info_key='trade-ws/info'): redis = okws.Redis(listen_channel, RedisCommand(redis_url, redis_info_key)) await redis.run()
async def run(redis_url='redis://localhost'): redis = okws.Redis(LISTEN_CHANNEL, RedisCommand(redis_url)) await redis.run()