Skip to content

Add utility for pipelining within 'with' statement. #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2013

Conversation

sirnicolaz
Copy link
Contributor

Just a small utility to use a pipeline in a controlled with block, like

import redis
from utils import pipeline

r = redis.StrictRedis(host='localhost', port=6379, db=0)

with pipeline(r) as p:
      p.set("foo", "bar")
      p.set("answer", 42)

Around the block, it's going to instantiate the pipeline and then execute it.

@andymccurdy
Copy link
Contributor

Thanks!

andymccurdy added a commit that referenced this pull request Nov 27, 2013
Add utility for pipelining within 'with' statement.
@andymccurdy andymccurdy merged commit b2101d3 into redis:master Nov 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants