(self, task: "Task")
| 107 | asyncio.get_event_loop().call_soon_threadsafe(partial(task.step, result)) |
| 108 | |
| 109 | def _on_task_finish(self, task: "Task"): |
| 110 | self._alive_coro_cnt -= 1 |
| 111 | |
| 112 | if task.coro_id in self.coros: |
| 113 | logger.debug('del self.coros[%s]', task.coro_id) |
| 114 | del self.coros[task.coro_id] |
| 115 | |
| 116 | if self._alive_coro_cnt <= 0 and not self.closed(): |
| 117 | self.send_task_command(dict(command='close_session')) |
| 118 | self._on_session_close() |
| 119 | self.close() |
| 120 | |
| 121 | def send_task_command(self, command): |
| 122 | """向会话发送来自协程内的消息 |
nothing calls this directly
no test coverage detected