from threading import Thread def async def wrapper args kwargs thr Thr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from threading import Thread
def async(f):
def wrapper(*args, **kwargs):
thr = Thread(target = f, args = args, kwargs = kwargs)
thr.start()
return wrapper
@async
def send_async_email(msg):
mail.send(msg)