Update daemon

This commit is contained in:
Patrick Jentsch
2020-06-10 14:18:02 +02:00
parent 6e26e38326
commit b3e467beac
5 changed files with 40 additions and 12 deletions

View File

@ -0,0 +1,14 @@
from functools import wraps
from threading import Thread
def background(f):
'''
' This decorator executes a function in a Thread.
'''
@wraps(f)
def wrapped(*args, **kwargs):
thread = Thread(target=f, args=args, kwargs=kwargs)
thread.start()
return thread
return wrapped