def execute(self, execution_request): """Invoke the engine for the given ExecutionRequest, returning Return and Throw states. :return: A tuple of (root, Return) tuples and (root, Throw) tuples. """ start_time = time.time() roots = list( zip( execution_request.roots, self._scheduler._run_and_return_roots(self._session, execution_request.native), ), ) ExceptionSink.toggle_ignoring_sigint_v2_engine(False) self._maybe_visualize() logger.debug( "computed %s nodes in %f seconds. there are %s total nodes.", len(roots), time.time() - start_time, self._scheduler.graph_len(), ) returns = tuple((root, state) for root, state in roots if type(state) is Return) throws = tuple((root, state) for root, state in roots if type(state) is Throw) return returns, throws
def run(self, request: InteractiveProcess) -> InteractiveProcessResult: ExceptionSink.toggle_ignoring_sigint_v2_engine(True) return self._scheduler.run_local_interactive_process(request)