sync.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:pathspider 作者: mami-project 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号