MCPcopy Create free account
hub / github.com/EasyIME/PIME / stop_server

Method stop_server

python/python3/tornado/test/httpclient_test.py:795–812  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

793
794 def tearDown(self):
795 def stop_server():
796 self.server.stop()
797 # Delay the shutdown of the IOLoop by several iterations because
798 # the server may still have some cleanup work left when
799 # the client finishes with the response (this is noticeable
800 # with http/2, which leaves a Future with an unexamined
801 # StreamClosedError on the loop).
802
803 @gen.coroutine
804 def slow_stop():
805 yield self.server.close_all_connections()
806 # The number of iterations is difficult to predict. Typically,
807 # one is sufficient, although sometimes it needs more.
808 for i in range(5):
809 yield
810 self.server_ioloop.stop()
811
812 self.server_ioloop.add_callback(slow_stop)
813
814 self.server_ioloop.add_callback(stop_server)
815 self.server_thread.join()

Callers

nothing calls this directly

Calls 2

stopMethod · 0.45
add_callbackMethod · 0.45

Tested by

no test coverage detected