Exemplo n.º 1
0
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))
Exemplo n.º 2
0
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!!")
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
async def run(redis_url='redis://localhost'):
    redis = okws.Redis(LISTEN_CHANNEL, RedisCommand(redis_url))
    await redis.run()