mirror of https://github.com/MagicStack/uvloop.git
Updated Home (markdown)
parent
4072967411
commit
f48eaf4afb
16
Home.md
16
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()
|
||||||
|
```
|
Loading…
Reference in New Issue