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 https://pypi-hypernode.com/pypi/greenlet
The source code repository is hosted on github: https://github.com/python-greenlet/greenlet
Documentation is available on readthedocs.org: https://greenlet.readthedocs.org
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.7-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d87581e0112cd57119a22564dc06aff07723b5c3f987903b0718dccdef84883 |
|
MD5 | 304571b184a840b17dd5f675f34e3620 |
|
BLAKE2b-256 | 7332dc5193bd67473177e9ee374a3e7a1fce6828f36d4f30935750ee158de8a8 |
Hashes for greenlet-0.4.7-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ae8aab1717b8fd6cf6db609f605dc5da277e2e42f310141a0f9110d5396097 |
|
MD5 | 4a95bc5295d6a49acd03532708ff0ef1 |
|
BLAKE2b-256 | c31aee32531a34fccf13cd9573e0089b8e114b283d82111be02569c4e4375e5b |
Hashes for greenlet-0.4.7-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c664ada2d702c504926b611c00e2364438ccf524f5250de87144459ca58e6d |
|
MD5 | 6226fd690ac62a79b025b1b06bddd77b |
|
BLAKE2b-256 | fc35e17e6a34b25594c752deca12aa6cbd51f7d60edf249d2d6393e6ab3b7c15 |
Hashes for greenlet-0.4.7-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5005138b058c3984ea461d0a12fb3bd5bcedc373955700851f978c453078e05 |
|
MD5 | 2ff1be814a0dbd525ee581fb7399e86e |
|
BLAKE2b-256 | f170207cb77985c4dbde52653355748364337eac6b1485f82582789d906bf1c6 |
Hashes for greenlet-0.4.7-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a77b077b5dd0e7c10f1b765999be3f976849caf9f897be2eed5c3b7efb2e093 |
|
MD5 | 71dee1a5f1fdd983a857d029de64c01f |
|
BLAKE2b-256 | 1b18d7688f721f06a9d08b95409e638a4cb13a63026f0750f2bd59ae9e25b098 |
Hashes for greenlet-0.4.7-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c86ce49e6d050a1c75ac498287b44ad6c744818d43d35243e250a584328ab63 |
|
MD5 | 49095db648e39926cc2f28b00d5f1d1b |
|
BLAKE2b-256 | 4cab509412b4231dc129ba7cf969184db683c08fd5546fddd3e165f1461cb00f |
Hashes for greenlet-0.4.7-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b68c6d39419b803bc8d36b57f3626fca864da1620b59c41d8a0ae246ee80851 |
|
MD5 | 9045980ccff6abfb7d802385e4f82749 |
|
BLAKE2b-256 | dc2444b03da01111f13d953cb3f83679c9b0ae714a4e5cd3754e7328d310aff7 |
Hashes for greenlet-0.4.7-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7c547ec510f70276126478c9eaadb416b4bc5e2930505ed1309e2cb71b3ad4 |
|
MD5 | 378aa907b712b9cbc81a113264bd9384 |
|
BLAKE2b-256 | 8a3e2184c1805d21c34c462171840927a9d430afbd46e3026df7f4cec7c8904b |
Hashes for greenlet-0.4.7-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bd18e9c29719e2628e89ce611d0488893cf8b34cb597b13d6e5f95414613df8 |
|
MD5 | 1fddda221a797de6a024eb9efdbdd29c |
|
BLAKE2b-256 | f2db0267be11ed52bca43dc50b5d410d9d251d3a79b66459d8c2c476e9c6204a |
Hashes for greenlet-0.4.7-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0f2c94b14710af32cb18b04f7784084e492d49fd0a7a59f27743d8f9bd5ee94 |
|
MD5 | b7d096aa2dd6f54d17fd70bd6d5e5d38 |
|
BLAKE2b-256 | b2c162c536f57c7db822bc4093cefe815dec0ad530b92222c7639533341d3721 |
Hashes for greenlet-0.4.7-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1e8ccc893013b1ca2d99c33a7d2b45cf0e1250cf1b33d099eb96c1490ab2bf |
|
MD5 | 69952e9db12707f31678e01ca0cad60c |
|
BLAKE2b-256 | d30156da541d4f1bbf8cada79a2235e2ec6376807f7b1c480e9c621c6aad6ff8 |
Hashes for greenlet-0.4.7-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 541bf3559df402f91c959b1c73d20bd55bb0d93ecf4344e6e00aaa9d651e72e7 |
|
MD5 | 0bc2af36d56ca7299b2317a3b16133ad |
|
BLAKE2b-256 | 99506d8f295be7a953df0bc369e29c811f514833b01c7ec55cd143b4a4677fe0 |