add: python tester
This commit is contained in:
11
test/thread_manager.py
Normal file
11
test/thread_manager.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import concurrent.futures
|
||||
|
||||
_pool = concurrent.futures.ThreadPoolExecutor(max_workers=10)
|
||||
|
||||
def add_to_queu(func: callable, args: tuple):
|
||||
global _pool
|
||||
_pool.submit(func, *args)
|
||||
|
||||
def wait_pool():
|
||||
global _pool
|
||||
_pool.shutdown(wait=True)
|
||||
Reference in New Issue
Block a user