Last active
September 16, 2016 15:42
-
-
Save HJulio/d7bc75bf50ba73988e56e93885d13c8f to your computer and use it in GitHub Desktop.
asycn flask decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@async | |
from threading import Thread | |
def async(f): | |
def wrapper(*args, **kwargs): | |
thr = Thread(target=f, args=args, kwargs=kwargs) | |
thr.start() | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment