MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-python-connector / increment

Function increment

tests/unit/test_rate_limiter.py:32–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 rate_limiter = AsyncRateLimiter(max_capacity=2, rate=1 / 5)
31
32 async def increment() -> None:
33 await rate_limiter.acquire()
34 nonlocal counter
35 counter += 1
36
37 # create 10 tasks calling increment()
38 tasks = [event_loop.create_task(increment()) for _ in range(10)]

Calls 1

acquireMethod · 0.80

Tested by

no test coverage detected