9 lines
281 B
Python
9 lines
281 B
Python
import asyncio
|
|
|
|
from aiohttp import ClientRequest, ClientResponse, ClientHandlerType
|
|
|
|
class Semaphore(asyncio.Semaphore):
|
|
async def __call__(self, req: ClientRequest, handler: ClientHandlerType) -> ClientResponse:
|
|
async with self:
|
|
return await handler(req)
|