Development of daun-builder
This commit is contained in:
11
modules/thread.py
Normal file
11
modules/thread.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Module to easily create threads
|
||||
import threading
|
||||
|
||||
|
||||
def threaded(func):
|
||||
"""
|
||||
Decorator to start a function in a new thread
|
||||
"""
|
||||
def thr(*args, **kwargs):
|
||||
threading.Thread(target=func, args=(*args,), kwargs={**kwargs, }).start()
|
||||
return thr
|
||||
Reference in New Issue
Block a user