mirror of
https://github.com/Cian-H/Melter.git
synced 2025-12-22 22:22:00 +00:00
Minor change for naming consistency
This commit is contained in:
14
Common/threading_decorators.py
Normal file
14
Common/threading_decorators.py
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
# *_* coding: utf-8 *_*
|
||||
|
||||
from threading import Thread
|
||||
from functools import wraps
|
||||
|
||||
|
||||
# Wrapper for running a function in a parallel thread
|
||||
def run_in_thread(func):
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
thread = Thread(target=func, args=args, kwargs=kwargs)
|
||||
thread.start()
|
||||
return wrapper
|
||||
Reference in New Issue
Block a user