Lightweight in-process concurrent programming
Project description
The greenlet package is a spin-off of Stackless, a version of CPython that supports micro-threads called “tasklets”. Tasklets run pseudo-concurrently (typically in a single or a few OS-level threads) and are synchronized with data exchanges on “channels”.
A “greenlet”, on the other hand, is a still more primitive notion of micro-thread with no implicit scheduling; coroutines, in other words. This is useful when you want to control exactly when your code runs. You can build custom scheduled micro-threads on top of greenlet; however, it seems that greenlets are useful on their own as a way to make advanced control flow structures. For example, we can recreate generators; the difference with Python’s own generators is that our generators can call nested functions and the nested functions can yield values too. Additionally, you don’t need a “yield” keyword. See the example in tests/test_generator.py.
Greenlets are provided as a C extension module for the regular unmodified interpreter.
Greenlets are lightweight coroutines for in-process concurrent programming.
Who is using Greenlet?
There are several libraries that use Greenlet as a more flexible alternative to Python’s built in coroutine support:
Getting Greenlet
The easiest way to get Greenlet is to install it with pip or easy_install:
pip install greenlet easy_install greenlet
Source code archives and windows installers are available on the python package index at http://pypi.python.org/pypi/greenlet
The source code repository is hosted on github: https://github.com/python-greenlet/greenlet
The master branch - i.e. the development version - can be installed directly by running one of the following:
pip install greenlet==dev easy_install greenlet==dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for greenlet-0.4.2.win-amd64-py3.3.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6519f2a84f62d150fc660e6e4c55c0d68ba65e0a6eac5eb05bbd9a0dc5cb51a7 |
|
MD5 | e563c455705a5c05b05279b16467efb9 |
|
BLAKE2b-256 | 8fe7a3c9d438b6d98968a1db8e64fa0a7ebfa5ab670912ffc38441008c93f012 |
Hashes for greenlet-0.4.2.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a1f122133c113f21188c6f07ffec0a75dbddab45d9f398216532cfde74ce0da |
|
MD5 | ecf74a210b67842e4759a8d81ad5ca62 |
|
BLAKE2b-256 | 007363fa90c85f94c2deebe229d940da56148bababc8678d3109bd3ff67f1ace |
Hashes for greenlet-0.4.2-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f5d77ba77311d969d9008f2ed6ed172c911655d70ea2384466144ca379b149 |
|
MD5 | 5828bfff73f65b9c0334d8d361a937e7 |
|
BLAKE2b-256 | 88aaaef946c33430cd36a866cf2251f6ede902b3d53e5db2a08440bf6d196874 |
Hashes for greenlet-0.4.2-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43d4de9776fe089aa822d54cc7103b5b403e725c13c2afd074551924416c3c5d |
|
MD5 | 20cbec64e2919d48890530fc73873314 |
|
BLAKE2b-256 | b66e612c9c49e56bb7fcd3af36f2861ca08798b49bcd14fc7f418a1679772319 |
Hashes for greenlet-0.4.2-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4536aee72713dff677998b2374ef0c282389345aa1485120d487d5558e328c4 |
|
MD5 | 2578fbcc9fa14997cb69af969b2faadb |
|
BLAKE2b-256 | 2249bc181cbcfd46c1128c44f0380a6317f9694a684bd98ef38d75bf9a19b04a |
Hashes for greenlet-0.4.2-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 298d45c49c7aaa188271d89e00f13c10bdf2904263400a9308bd8b410b6593d8 |
|
MD5 | fbfdd3d8dec8323ff6b3467c8931d7c4 |
|
BLAKE2b-256 | 210aea79121efece1e1e8dc7d049e7c0fe293e9260d654136bce1428d9fda757 |