1
0
Files
mandu-crawler/utils/middlewares.py
2025-08-04 09:56:02 +09:00

9 lines
291 B
Python

import asyncio
from aiohttp import ClientRequest, ClientResponse, ClientHandlerType
class SemaphoreMiddleware(asyncio.Semaphore):
async def __call__(self, req: ClientRequest, handler: ClientHandlerType) -> ClientResponse:
async with self:
return await handler(req)