Skip to content

Request: Support pipeline for Redis #265

Description

@polywock

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions