Closed pravic closed 2 years ago
cc @AlecHaring
Looks really good. I like your idea of using ThreadPoolExecutor
so that you can make use of its submit
method instead of manually creating new threads for each call. I suspect it would be significantly more efficient this way.
I suspect it would be significantly more efficient this way.
Well, definitely. Because it maintains a pool of threads: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
@script(threading=True)
calls the handler in a separate thread usingconcurrent.futures.ThreadPoolExecutor
.Usage in TIScript:
Usage in JS:
Usage in Python: