1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
.. image:: https://travis-ci.org/MagicStack/uvloop.svg?branch=master
:target: https://travis-ci.org/MagicStack/uvloop
.. image:: https://img.shields.io/pypi/status/uvloop.svg?maxAge=2592000?style=plastic
:target: https://pypi.python.org/pypi/uvloop
.. image:: https://img.shields.io/github/stars/magicstack/uvloop.svg?style=social&label=GitHub
:target: https://github.com/MagicStack/uvloop
uvloop
======
`uvloop` is a fast, drop-in replacement of the built-in asyncio event loop.
`uvloop` is released under the MIT license.
`uvloop` and asyncio, combined with the power of async/await in Python 3.5,
makes it easier than ever to write high-performance networking code in Python.
`uvloop` makes asyncio fast. In fact, it is at least 2x faster than nodejs,
gevent, as well as any other Python asynchronous framework. The performance of
uvloop-based asyncio is close to that of Go programs.
You can read more about uvloop in this
`blog post <http://magic.io/blog/uvloop-blazing-fast-python-networking/>`_.
Architecture
------------
The asyncio module, introduced by PEP 3156, is a collection of network
transports, protocols, and streams abstractions, with a pluggable event loop.
The event loop is the heart of asyncio. It provides APIs for:
- scheduling calls,
- transmitting data over the network,
- performing DNS queries,
- handling OS signals,
- convenient abstractions to create servers and connections,
- working with subprocesses asynchronously.
`uvloop` implements the :class:`asyncio.AbstractEventLoop` interface which
means that it provides a drop-in replacement of the asyncio event loop.
`uvloop` is written in Cython and is built on top of libuv.
libuv is a high performance, multiplatform asynchronous I/O library used by
nodejs. Because of how wide-spread and popular nodejs is, libuv is fast and
stable.
`uvloop` implements all asyncio event loop APIs. High-level Python objects
wrap low-level libuv structs and functions. Inheritance is used to keep the
code DRY and ensure that any manual memory management is in sync with libuv
primitives' lifespans.
Contents
--------
.. toctree::
:maxdepth: 1
user/index
dev/index
|