diff --git a/common/threadpool.py b/common/threadpool.py new file mode 100644 index 0000000000000000000000000000000000000000..8a613a97f211d8e951acbef750d8856db19a79e2 --- /dev/null +++ b/common/threadpool.py @@ -0,0 +1,16 @@ +# -*- coding:utf-8 -*- +#!/usr/bin/env python +# cython:language_level=3 + +from concurrent.futures import ThreadPoolExecutor +from common.decorator_wrap import DecoratorWrap + +@DecoratorWrap.singleton +class ThreadPool(): + def __init__(self, max_threads = 10): + # Maximum concurrent threads + self.__max_threads = max_threads + self.__thread_obj = ThreadPoolExecutor(self.__max_threads) + # Store the created thread + self.__generate_list = [] + \ No newline at end of file