UnisKB/apps/common/event/common.py

28 lines
564 B
Python
Raw Normal View History

# coding=utf-8
"""
@project: maxkb
@Author
@file common.py
@date2023/11/10 10:41
@desc:
"""
from concurrent.futures import ThreadPoolExecutor
work_thread_pool = ThreadPoolExecutor(5)
embedding_thread_pool = ThreadPoolExecutor(3)
def poxy(poxy_function):
2024-07-18 02:26:16 +00:00
def inner(args, **keywords):
work_thread_pool.submit(poxy_function, args, **keywords)
return inner
def embedding_poxy(poxy_function):
2024-07-18 02:26:16 +00:00
def inner(args, **keywords):
embedding_thread_pool.submit(poxy_function, args, **keywords)
return inner