async-redis
async-redis copied to clipboard
v2 completely broke several connections to single redis
Just abstract example:
(async f1() {
const client1 = asyncRedis.createClient();
await client1.blpop("some", 0);
})()
(async f2() {
const client2 = asyncRedis.createClient();
await client2.lpush("some", 42);
})()
f2's lpush will never be called as client1 and client2 share same connection due to new implementation
duplicated of #60 :p
an workaround:
(async f1() {
const client1 = asyncRedis.createClient({ _id: 1 });
await client1.blpop("some", 0);
})()
(async f2() {
const client2 = asyncRedis.createClient({ _id: 2 });
await client2.lpush("some", 42);
})()
you must pass different options for each client.