Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AsyncProtectProcessing:
- def __init__(self) -> None:
- pass
- def foo(async_function):
- async def wrapper(*args, **kwargs):
- cls, data = args
- cls.user = "some_data"
- return await async_function(*args, **kwargs)
- return wrapper
- class ScrapingTasks(HTTPEndpoint):
- @AsyncProtectProcessing.foo
- async def get(self, request: Request) -> JSONResponse:
- print(self.user)
- return JSONResponse("asdasdas")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement