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

Method _cleanup

pywebio/session/coroutinebased.py:153–162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

151 return msgs
152
153 def _cleanup(self):
154 for t in list(self.coros.values()): # t.close() may cause self.coros changed size
155 t.step(SessionClosedException, throw_exp=True)
156 # in case that the task catch the SessionClosedException, we need to close it manually
157 t.close()
158 self.coros = {} # delete session tasks
159
160 # reset the reference, to avoid circular reference
161 self._on_session_close = None
162 self._on_task_command = None
163
164 def close(self, nonblock=False):
165 """关闭当前Session。由Backend调用"""

Callers 1

closeMethod · 0.95

Calls 2

stepMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected