threaded decorator now return the thread

This commit is contained in:
Faraphel 2022-07-18 19:51:20 +02:00
parent 186aa55f4a
commit 39bd521511

View file

@ -27,7 +27,9 @@ def threaded(func: Callable) -> Callable:
def wrapper(*args, **kwargs):
# run the function in a Daemon, so it will stop when the main thread stops
Thread(target=func, args=args, kwargs=kwargs, daemon=True).start()
thread = Thread(target=func, args=args, kwargs=kwargs, daemon=True)
thread.start()
return thread
return wrapper