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.set("someKey", "true")
redis.expire("someKey", 1000)
// Awaiting adds a round trip
await redis.set("someKey", "true")
redis.expire("someKey", 1000)
// No round trip, fast and guaranteed order
const pipeline = redis.pipeline()
pipeline.set("someKey", "true")
pipeline.expire("someKey", 1000)
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()