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

Method close

pywebio/session/base.py:109–127  ·  view source on GitHub ↗

Close current session :param bool nonblock: Don't block thread. Used in closing from backend.

(self, nonblock=False)

Source from the content-addressed store, hash-verified

107 raise NotImplementedError
108
109 def close(self, nonblock=False):
110 """Close current session
111
112 :param bool nonblock: Don't block thread. Used in closing from backend.
113 """
114 if self._closed:
115 return
116 self._closed = True
117
118 self.deferred_functions.reverse()
119 while self.deferred_functions:
120 func = self.deferred_functions.pop()
121 try:
122 func()
123 except Exception as e:
124 msg = "Error occurred when running deferred function %s" % func
125 if isinstance(e, SessionException):
126 msg = "PyWebIO interactive functions cannot be called inside the deferred functions."
127 logger.exception(msg)
128
129 def closed(self) -> bool:
130 return self._closed

Callers 10

testFunction · 0.45
close_sessionMethod · 0.45
mainFunction · 0.45
wait_host_portFunction · 0.45
oFunction · 0.45
bootstrap.min.jsFile · 0.45
oFunction · 0.45
prism.min.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected