| 79 | return create({}) |
| 80 | |
| 81 | def run(self): |
| 82 | shell = self.get_shell() |
| 83 | while True: |
| 84 | output = [] |
| 85 | with CaptureErrors(output): |
| 86 | next_task = self.task_queue.get() |
| 87 | answer = next_task(shell) |
| 88 | if len(output) > 0: # means backend error happened |
| 89 | answer = output |
| 90 | output = [] |
| 91 | with CaptureErrors(output): |
| 92 | self.result_queue.put_nowait(answer) |
| 93 | if len(output) > 0: # means backend error happened |
| 94 | self.result_queue.put_nowait(output) |
| 95 | if isinstance(next_task, TaskKillProcess): |
| 96 | break # break while loop -> we do not wait upon new task |
| 97 | return |
| 98 | |
| 99 | def executeTask(self, task): |
| 100 | self.task_queue.put_nowait(task) |