Search code examples
pythonredistornado-redis

tornado-redis connection unixsocket


could anyone explain how to connect to redis using unixsockets.

redis_conn = tornadoredis.Client('hostname', 'port')
redis_conn.connect()

I do not have hostname or port for redis-server, I commented bind lines in it config, and cofiguired it to use socket:

unixsocket /var/run/redis/redis.sock
unixsocketperm 755

Can you please explin it to me ot give me the link to documents please.


Solution

  • I found an answer here in code https://github.com/leporo/tornado-redis/blob/master/tornadoredis/connection.py: It seams it should work something like:

    redis_conn = tornadoredis.Client(unix_socket_path='/var/run/redis/redis.sock')
    redis_conn.connect()