microblog2/app/decorators.py

9 lines
175 B
Python
Raw Normal View History

2012-12-16 08:36:04 +00:00
from threading import Thread
2012-12-16 08:36:04 +00:00
def async(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
2012-12-16 08:36:04 +00:00
thr.start()
return wrapper