def main_loop(self):
        """The main loop a worker runs to receive and execute tasks."""

        def exit(signum, frame):
            shutdown()
            sys.exit(0)

        signal.signal(signal.SIGTERM, exit)

        while True:
            task = self._get_next_task_from_raylet()
            self._wait_for_and_process_task(task)
def main_loop ( self ) : def exit ( signum , frame ) : shutdown ( ) sys . exit ( 0 ) signal . signal ( signal . SIGTERM , exit ) while True : task = self . _get_next_task_from_raylet ( ) self . _wait_for_and_process_task ( task )
The main loop a worker runs to receive and execute tasks.