andymccurdy/redis-py — pull request #373 by sirnicolaz (2013-08-17 08:59:53+00:00)
Title: Add utility for pipelining within 'with' statement.

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

```python
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.