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.0.win-amd64-py3.3.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1a60b475f0a243336425984b5ce7770dd67e9b8a15da2a554f55de1c274ef09 |
|
MD5 | af96a2e90a0a13556f351e733c64211b |
|
BLAKE2b-256 | 3de410e9b67b7ea903b6c5b80c2c2494c0f16aeee0c15a4d599aa450dc8883ef |
Hashes for greenlet-0.4.0.win-amd64-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6bf41bcca1aec12b6db31a03ee4d08721da7cb6d98e88b970baca5c1f72f006 |
|
MD5 | 16924fd31ed107edd71bcb8741a5fa60 |
|
BLAKE2b-256 | 4e21c139a5ef6c1ecde32f1c1611185145646a5b36d0e572a1738e2036eb8d45 |
Hashes for greenlet-0.4.0.win-amd64-py3.1.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | f498592dafd0018bb8512e50b1b39d4e20108de2fe119a46887306b14d3d39ce |
|
MD5 | 6b84e0e445be6e188733e9096f544fee |
|
BLAKE2b-256 | 41942a3954c50a5e5cc55a72128e2687f99385c842a98ee5788a229aefacea51 |
Hashes for greenlet-0.4.0.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41ce8be83ec2f9d5b10b0c809297f96a1892806c91a53fa55d6cdd332e8f2929 |
|
MD5 | 3f8e62c2ee68e26301105fe9caba93c3 |
|
BLAKE2b-256 | f9a8f53dcee64a8733e1a8f11a85a1e012f39f72b52e158201908a388cba7868 |
Hashes for greenlet-0.4.0-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 957983a44534e1544c756b7522be8cf77f2c0859b543b49a958d5388cdcba139 |
|
MD5 | f08d5ad2be5f2c669d4c66eb332c4dba |
|
BLAKE2b-256 | d4dfa3f9183e80d28b3bcd035b04e7d4d2b3ca3413cfe132f4252e065720af53 |
Hashes for greenlet-0.4.0-py3.2-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc1d676c68cc356dd9b96e9a6151f6c80d10b872106c0c9d6e01eba407bb67a |
|
MD5 | f306474ce2f4e9cde21d2057ea9aff87 |
|
BLAKE2b-256 | 148cda47d8db994125fa8902c76020f36c2d0db7ae36663de92b3f334ce27fef |
Hashes for greenlet-0.4.0-py3.1-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a74364169a35f9cd33fbe007944b212ed0be0a015a9786a9883de9a30330f22e |
|
MD5 | a7d0133b191f9fe3cd3d58533ea3273e |
|
BLAKE2b-256 | bbef8ed9e3b49cc7ec0d9c296b212626ccbe381491580d1e0fbdba7cb8be4bc3 |
Hashes for greenlet-0.4.0-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a91228aff1cb0404b4c98230c792c59f74d60f6aa7d2572e33d1863b1233d74b |
|
MD5 | e295950b690758ce72f2091b40862fa3 |
|
BLAKE2b-256 | 017c85bf938045e59b3576f87ea8802c1544179b4cfc9b5b9d450895b788d770 |