Skip to content

Instantly share code, notes, and snippets.

@DBoyara
Created September 8, 2021 14:46
Show Gist options
  • Select an option

  • Save DBoyara/3b895d0e19bab51ee48e0617a3d9d342 to your computer and use it in GitHub Desktop.

Select an option

Save DBoyara/3b895d0e19bab51ee48e0617a3d9d342 to your computer and use it in GitHub Desktop.
Python Simple Async-Decorator
from functools import wraps
def dec(fn):
@wraps(fn)
async def wrapper(*args, **kwargs):
print(fn.__name__, args, kwargs)
await asyncio.sleep(5)
await fn(*args, **kwargs)
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment