Expand pylibmc.ClientPool.reserve
documentation.
This commit is contained in:
parent
b3b36b3acb
commit
956355ee27
@ -163,7 +163,11 @@ class ClientPool(Queue):
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def reserve(self, timeout=None):
|
def reserve(self, timeout=None):
|
||||||
"""Reserve a client, and put it back into the pool when done."""
|
"""Context manager for reserving a client from the pool.
|
||||||
|
|
||||||
|
If *timeout* is given, it specifiecs how long to wait for a client to
|
||||||
|
become available.
|
||||||
|
"""
|
||||||
mc = self.get(True, timeout=timeout)
|
mc = self.get(True, timeout=timeout)
|
||||||
try:
|
try:
|
||||||
yield mc
|
yield mc
|
||||||
|
Reference in New Issue
Block a user