Skip to content

Request: Support pipeline for Redis #265

@polywock

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions