View all files | ||||
The asyncio module provides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives. Here is a more detailed list of the package contents:
Note: The implementation of asyncio was previously called "Tulip".
To install asyncio, type:
pip install asyncioasyncio requires Python 3.3 or later! The asyncio module is part of the Python standard library since Python 3.4.
asyncio is a free software distributed under the Apache license version 2.0.
The actual code lives in the 'asyncio' subdirectory. Tests are in the 'tests' subdirectory.
To run tests, run:
toxOr use the Makefile:
make testTo run coverage (coverage package is required):
make coverageOn Windows, things are a little more complicated. Assume P is your Python binary (for example C:\Python33\python.exe).
You must first build the _overlapped.pyd extension and have it placed in the asyncio directory, as follows:
C:\> P setup.py build_ext --inplaceIf this complains about vcvars.bat, you probably don't have the required version of Visual Studio installed. Compiling extensions for Python 3.3 requires Microsoft Visual C++ 2010 (MSVC 10.0) of any edition; you can download Visual Studio Express 2010 for free from http://www.visualstudio.com/downloads (scroll down to Visual C++ 2010 Express).
Once you have built the _overlapped.pyd extension successfully you can run the tests as follows:
C:\> P runtests.pyAnd coverage as follows:
C:\> P runtests.py --coverage