MCPcopy
hub / github.com/aio-libs/aiohttp / close

Method close

aiohttp/worker.py:57–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

55
56 @asyncio.coroutine
57 def close(self):
58 if self.servers:
59 servers = self.servers
60 self.servers = None
61
62 # stop accepting connections
63 for server, handler in servers.items():
64 self.log.info("Stopping server: %s, connections: %s",
65 self.pid, len(handler.connections))
66 server.close()
67
68 # send on_shutdown event
69 yield from self.wsgi.shutdown()
70
71 # stop alive connections
72 tasks = [
73 handler.finish_connections(
74 timeout=self.cfg.graceful_timeout / 100 * 95)
75 for handler in servers.values()]
76 yield from asyncio.wait(tasks, loop=self.loop)
77
78 # stop application
79 yield from self.wsgi.finish()
80
81 @asyncio.coroutine
82 def _run(self):

Callers 3

_runMethod · 0.95
init_processMethod · 0.45
runMethod · 0.45

Calls 4

shutdownMethod · 0.80
finish_connectionsMethod · 0.80
waitMethod · 0.80
finishMethod · 0.80

Tested by

no test coverage detected