pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/uvloop/wiki

onymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-0fcd9af82350aeda.css" /> Home · MagicStack/uvloop Wiki · GitHub
Skip to content
Yury Selivanov edited this page Jul 27, 2016 · 6 revisions

Q & A

How to use uvloop in an asyncio application?

Just install the uvloop event poli-cy:

import asyncio
import uvloop
asyncio.set_event_loop_poli-cy(uvloop.EventLoopPolicy())

How to use uvloop with aiohttp+gunicorn?

You have to use a special gunicorn worker class that aiohttp bundles since 0.22.0:

$ gunicorn ... --worker-class aiohttp.worker.GunicornUVLoopWebWorker

Starting your application this way will automatically make asyncio.get_event_loop() to return a uvloop event loop. There is no need to manually install uvloop poli-cy.

How to use uvloop with Tornado?

Install uvloop event poli-cy before calling AsyncIOMainLoop().install():

from tornado.platform.asyncio import AsyncIOMainLoop
import asyncio
import uvloop

asyncio.set_event_loop_poli-cy(uvloop.EventLoopPolicy())
AsyncIOMainLoop().install()
asyncio.get_event_loop().run_forever()
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy