diff options
author | andy <andy@whiskeymedia.com> | 2011-07-17 15:15:15 -0700 |
---|---|---|
committer | andy <andy@whiskeymedia.com> | 2011-07-17 15:15:15 -0700 |
commit | 2e185683e310513d4efdcf9ec212115383f03aff (patch) | |
tree | 2b23bb4d72d3c45d7e3a07065d5e8cfdb7583f3c /README.md | |
parent | 2d428eca210154d07ab4260fdb1cccf14954295e (diff) | |
download | redis-py-2e185683e310513d4efdcf9ec212115383f03aff.tar.gz |
Pipelines can now be used as Context Managers. Thanks David Wolever. Fixes #160
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -198,11 +198,12 @@ could do something like this: ... # our best bet is to just retry. ... continue -Note that, because the `Pipeline` must bind to a single connection for the -duration of a `watch`, care must be taken to ensure that he connection is -returned to the connection pool by calling the `reset()` method. If the -`Pipeline` is used as a context manager (as in the example above) `reset()` -will be called automatically... But it can also be called manually, like this: +Note that, because the Pipeline must bind to a single connection for the +duration of a WATCH, care must be taken to ensure that he connection is +returned to the connection pool by calling the reset() method. If the +Pipeline is used as a context manager (as in the example above) reset() +will be called automatically. Of course you can do this the manual way as by +explicity calling reset(): >>> pipe = r.pipeline() >>> while 1: |