MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / _on_task_finish

Method _on_task_finish

pywebio/session/coroutinebased.py:109–119  ·  view source on GitHub ↗
(self, task: "Task")

Source from the content-addressed store, hash-verified

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 """向会话发送来自协程内的消息

Callers

nothing calls this directly

Calls 3

send_task_commandMethod · 0.95
closeMethod · 0.95
closedMethod · 0.65

Tested by

no test coverage detected