MCPcopy
hub / github.com/tornadoweb/tornado / main

Function main

demos/blog/blog.py:297–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296
297async def main():
298 tornado.options.parse_command_line()
299
300 # Create the global connection pool.
301 async with aiopg.create_pool(
302 host=options.db_host,
303 port=options.db_port,
304 user=options.db_user,
305 password=options.db_password,
306 dbname=options.db_database,
307 ) as db:
308 await maybe_create_tables(db)
309 app = Application(db)
310 app.listen(options.port)
311
312 # In this demo the server will simply run until interrupted
313 # with Ctrl-C, but if you want to shut down more gracefully,
314 # call shutdown_event.set().
315 shutdown_event = tornado.locks.Event()
316 await shutdown_event.wait()
317
318
319if __name__ == "__main__":

Callers 1

blog.pyFile · 0.70

Calls 5

listenMethod · 0.95
waitMethod · 0.95
maybe_create_tablesFunction · 0.85
parse_command_lineMethod · 0.80
ApplicationClass · 0.70

Tested by

no test coverage detected