def acquire_n(self, value=1, blocking=True, timeout=None):
"""
Acquire ``value`` number of tokens at once.
The parameters ``blocking`` and ``timeout`` have the same semantics as
:class:`BoundedSemaphore`.
:returns: The same value as the last call to `BoundedSemaphore`'s
:meth:`acquire` if :meth:`acquire` were called ``value`` times instead
of the call to this method.
"""
ret = None
for _ in range(value):
ret = self.acquire(blocking=blocking, timeout=timeout)
return ret
评论列表
文章目录