MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / shutdown

Method shutdown

mssqlcli/jsonrpc/jsonrpcclient.py:169–183  ·  view source on GitHub ↗

Signal request thread to close as soon as it can.

(self)

Source from the content-addressed store, hash-verified

167 self.exception_queue.put(ex)
168
169 def shutdown(self):
170 """
171 Signal request thread to close as soon as it can.
172 """
173 self.cancel = True
174 # Enqueue None to optimistically unblock background threads so
175 # they can check for the cancellation flag.
176 self.request_queue.put(None)
177
178 # Wait for request thread to finish with a timeout in seconds.
179 self.request_thread.join(1)
180
181 # close the underlying writer.
182 self.writer.close()
183 logger.info('Shutting down Json rpc client.')
184
185
186class ReadState(enum.Enum):

Calls 1

closeMethod · 0.45