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.3.4.win-amd64-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f98805dba10173f93a27faed876179d04d60136e3dbe5fa2387c2592f812e4c |
|
MD5 | fb0418279e07f08077b8070b8d660738 |
|
BLAKE2b-256 | 12662b635534355a1b4f2b6f33edde789c70a7a1d59555e267968aa99394a1fe |
Hashes for greenlet-0.3.4.win-amd64-py3.1.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e6c977cc962f01e95f949bc6d10bb93386788c2e22c68c8f22001ef5eeab58a |
|
MD5 | a0cf9da5746cd9f1c17fe0faf9512887 |
|
BLAKE2b-256 | d30af967db58d4525511bd80593c2bcda851fe0d24ddd5a6571af9934bde6bf6 |
Hashes for greenlet-0.3.4.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aed6e7b96d6b3ef54d329a0547477cb13a8b66159f57e37dd0849f98c3cfc03 |
|
MD5 | cf44638d879a92fb135306890e38903b |
|
BLAKE2b-256 | c54692385a554b0d681c0ab3ad404925d1a0877f9d5586374863995b923c5096 |
Hashes for greenlet-0.3.4-py3.2-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28dcb0b24d3f3d46975f5c3d95183dedfeda7f5e2c709681787ec40969c2b836 |
|
MD5 | 14455b258e92d17ccf18ccbcada22932 |
|
BLAKE2b-256 | a342e7ea0d4efb91502802c688b02f77fbccb57ea962e3eb1756c91ddbaf71e2 |
Hashes for greenlet-0.3.4-py3.1-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | afcd2c347e99bc451c6a469353c0aba2c0b1fcc1014909e985948a7989cec070 |
|
MD5 | 0b37cadd7aa49db5335cc7ee5fe6ca36 |
|
BLAKE2b-256 | f4eb5b3d6a1721bb1d2a1ceeebc4e7e05ddf8cdfccec10a636945d04025ce2ac |
Hashes for greenlet-0.3.4-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 907016d04b48a5370ff12bb0c407c30280e72886f3d5342589db18928d28368c |
|
MD5 | 9a4215d99a0dce433a29f1f309588569 |
|
BLAKE2b-256 | 1922a44dcfc8dbbc1f173733826afcc6a4bb4e5af30cce4a71515b04db334ff2 |