From f48eaf4afb7e4edad93e331c0be03a7ee6324715 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Tue, 12 Jul 2016 22:43:42 -0400 Subject: [PATCH] Updated Home (markdown) --- Home.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Home.md b/Home.md index bdca148..bfe70f8 100644 --- a/Home.md +++ b/Home.md @@ -1 +1,15 @@ -Welcome to the uvloop wiki! +# Q & A + +### How to use uvloop with Tornado? + +Install uvloop event policy before calling `AsyncIOMainLoop().install()`: + +```python +from tornado.platform.asyncio import AsyncIOMainLoop +import asyncio +import uvloop + +asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) +AsyncIOMainLoop().install() +asyncio.get_event_loop().run_forever() +``` \ No newline at end of file