INNER CODE UNIT · Python

submit_to_threadpool

autokitteh/autokitteh · runtimes/pythonrt/runner/main.py:330

    def submit_to_threadpool(self, fn, *args, **kw):
        log.info("submitting to threadpool: %s", full_func_name(fn))

        def cb(fut):
            log.info("execution on threadpool done: %s", full_func_name(fn))
            if exc := fut.exception():
                log.error(
                    "Uncaught exception in executor: %r, traceback: %s",
                    exc,
                    format_exception(exc),
                )
                force_close(self.server)

        fut = self.executor.submit(fn, *args, **kw)
        fut.add_done_callback(cb)

        return fut

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…