Need to be able to turn off thread creation in the ThreadPoolExecutor
import sys
from concurrent.futures import Executor, Future
class SynchronousExecutor(Executor):
"""Executes immediately on the calling thread."""
def submit(self, fn, /, *args, **kwargs):
future = Future()
try:
future.set_result(fn(*args, **kwargs))
except BaseException as exc:
future.set_exception(exc)
return future
def make_executor(max_workers=None):
if sys.platform == "emscripten":
return SynchronousExecutor()
from concurrent.futures import ThreadPoolExecutor
return ThreadPoolExecutor(max_workers=max_workers)
Dependencies
All dependencies now work in pyemscripten, see kylebarron/arro3#502, kylebarron/arro3#504, geoarrow/geoarrow-rs#1448
Need to be able to turn off thread creation in the
ThreadPoolExecutorDependencies
All dependencies now work in pyemscripten, see kylebarron/arro3#502, kylebarron/arro3#504, geoarrow/geoarrow-rs#1448