GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Home

Home

Jump to bottom Edit New page
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 policy:

import asyncio
import uvloop
asyncio.set_event_loop_policy(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 policy.

How to use uvloop with Tornado?

Install uvloop event policy before calling AsyncIOMainLoop().install():

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()
Add a custom footer
Add a custom sidebar

Clone this wiki locally

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.