Commit 41eb85b1 authored by Richard Oudkerk's avatar Richard Oudkerk

Make AcquirerProxy.acquire() support timeout argument

parent b78174c0
...@@ -957,8 +957,9 @@ class IteratorProxy(BaseProxy): ...@@ -957,8 +957,9 @@ class IteratorProxy(BaseProxy):
class AcquirerProxy(BaseProxy): class AcquirerProxy(BaseProxy):
_exposed_ = ('acquire', 'release') _exposed_ = ('acquire', 'release')
def acquire(self, blocking=True): def acquire(self, blocking=True, timeout=None):
return self._callmethod('acquire', (blocking,)) args = (blocking,) if timeout is None else (blocking, timeout)
return self._callmethod('acquire', args)
def release(self): def release(self):
return self._callmethod('release') return self._callmethod('release')
def __enter__(self): def __enter__(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment