redis-py

Redis-py hset() mapping – TypeError when setting multiple item values

Redis-py hset() mapping – TypeError when setting multiple item values Question: I am building some very large lookup tables in Redis. I have some straightforward code that works as intended when looping through a dict to set a single value in my Redis hash (via a pipeline) for each item using hset(): foo = {“1234”: …

Total answers: 3

Does the redis-py module work with Redis in Cluster mode?

Does the redis-py module work with Redis in Cluster mode? Question: I’m trying to use redis-py with redis in cluster mode, but I can’t get it to work. I see that redis-py-cluster works, but I have a preference for redis-py as I have been using it and it’s a recommended client. Asked By: pettinato || …

Total answers: 3

How to insert Billion of data to Redis efficiently?

How to insert Billion of data to Redis efficiently? Question: I have around 2 billion key-value pairs and I want to load them into Redis efficiently. I am currently using Python and used Pipe as documented by the redis-py. How can I speed the following approach up? import redis def load(pdt_dict): “”” Load data into …

Total answers: 5

What's the difference between the API of Redis and StrictRedis?

What's the difference between the API of Redis and StrictRedis? Question: I’m working on a project with redis.py, I works when I connect the app to a Redis client, but failed with StrictRedis. So, I wanna know the difference between the two, but searched with no satisfied answer. My project is here: https://github.com/kxxoling/librorum Sorry for …

Total answers: 2

Is non-blocking Redis pubsub possible?

Is non-blocking Redis pubsub possible? Question: I want to use redis’ pubsub to transmit some messages, but don’t want be blocked using listen, like the code below: import redis rc = redis.Redis() ps = rc.pubsub() ps.subscribe([‘foo’, ‘bar’]) rc.publish(‘foo’, ‘hello world’) for item in ps.listen(): if item[‘type’] == ‘message’: print item[‘channel’] print item[‘data’] The last for …

Total answers: 11