Refactor code for speed and clarity
This commit is contained in:
Glenn Jocher authored and GitHub committed 2024-06-30 12:34:04 +02:00
1 parent 05e59bdec1
commit b9019671f4
13 files changed
+29 -5

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ def threaded(func):
"""Decorator @threaded to run a function in a separate thread, returning the thread instance."""
def wrapper(*args, **kwargs):
"""Runs the decorated function in a separate daemon thread and returns the thread instance."""
thread = threading.Thread(target=func, args=args, kwargs=kwargs, daemon=True)
thread.start()
return thread