    def run_as_thread(self, params:Parameters, direct_params, task_run:TaskRun, **kwargs):
        """Create a new thread and run the task on that."""

        terminate_event = params.get('_thread_terminate_', threading.Event())

        params = params.pre_materialize(task=self, session=self.session, terminate_event=terminate_event)
        direct_params = direct_params.pre_materialize(task=self, session=self.session, terminate_event=terminate_event)

        thread = threading.Thread(target=self._run_as_thread, args=(params, direct_params, task_run))
        task_run.task = thread
        task_run.event_terminate = terminate_event
        task_run.event_running = threading.Event()

        self._run_stack.append(task_run)

        self._last_run = self.session.get_time() # Needed for termination
        thread.start()
        task_run.event_running.wait() # Wait until the task is confirmed to run
Create a new thread and run the task on that.
rocketry/core/task.py