upstash / redis-py

HTTP based Python Redis Client for Serverless and Edge Functions
https://docs.upstash.com/redis
MIT License
26 stars 3 forks source link

Support for Pipeline and Transaction in python #45

Closed reubenjohn closed 3 months ago

reubenjohn commented 5 months ago

The typescript client supports these commands: https://upstash.com/docs/oss/sdks/ts/redis/commands/transaction. Curious to know if these will be available in the Python SDK any time soon?

Pipeline Typescript SDK Usage

const p = redis.pipeline()
p.set('foo', 'bar')
p.get('foo')
const res = await p.exec()

Transaction Typescript SDK Usage

const tx = redis.multi()
tx.set('foo', 'bar')
tx.get('foo')
const res = await tx.exec()
mmangus commented 4 months ago

+1 to this request, pipelining is absolutely indispensable for using redis over the internet in my opinion. i hacked together pipelining for my org by subclassing the client to add a method that uses the _session, _url and _headers to send commands to the /pipeline REST endpoint, but would much prefer to have proper support built into the SDK e.g. a context manager with redis.pipeline() as pipe: ....

coratype commented 3 months ago

any updates on this?

CahidArda commented 3 months ago

Hi @coratype, we are working on it in #47. We hope to release it very soon!

CahidArda commented 3 months ago

Hi again, we added pipelines and transactions as of version 1.1.0!

Closing this issue.