pip install tomorrow python from tomorrow import concurrent import time python @concurrent def my_function(arg1, arg2): python for task in tasks: my_function(*task) python future = my_function(arg1, arg2) python from tomorrow import concurrent import time @concurrent def my_function(arg1, arg2): return arg1 + arg2 if __name__ == "__main__": futures = [] for task in tasks: future = my_function(*task) futures.append(future) for future in futures: print(result) python @concurrent(thread_pool_size=10) def my_function(arg1, arg2): ...


上一篇:
下一篇:
切换中文