It would be great to have a pipeline API on Devvit's redis client. Right now, to guarantee command ordering you have to await each call individually, which adds a round trip per command. With pipelining, commands could be batched and sent in a single TCP write without transaction overhead. Many Redis clients (E.g. ioredis) expose it through .pipeline()
// Not guaranteed Redis receives first command first.
redis.zAdd(...)
redis.zRank(...)
// Awaiting adds a round trip
await redis.zAdd(...)
redis.zRank(...)
// No round trip, fast and guaranteed order
const pipeline = redis.pipeline()
pipeline.redis.zAdd(...)
pipeline.redis.zRank(...)
const [ _, rankResult ] = await pipeline.exec()
It would be great to have a pipeline API on Devvit's redis client. Right now, to guarantee command ordering you have to await each call individually, which adds a round trip per command. With pipelining, commands could be batched and sent in a single TCP write without transaction overhead. Many Redis clients (E.g. ioredis) expose it through .pipeline()