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.6-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98b5ee0bc3ab5b5798a0cfe3f6058170591e238ea4fcbd5f20ba6830411fd5b |
|
MD5 | 4031cd54ff6da86d85bf464c4aa8886a |
|
BLAKE2b-256 | af8384e47bfd3fe0a62c9e8759178a237203f4222cf3e1de205712288f6bf555 |
Hashes for greenlet-0.4.6-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a04faea1a1d83447f21a2a8cad085b682bd22bd31815564b6a290ff78b09c48 |
|
MD5 | 89b4fc0b8ddd54971dd74ad58d787901 |
|
BLAKE2b-256 | 9e8611a9fc9e3bd61a9ca662127cc3118a7b6a7338ff1fac78592f3252bf6765 |
Hashes for greenlet-0.4.6-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc5a00ac71f7c24eb31e66efc6bf7adedde8d4f2be5af73b0d3ca94058d1f2c8 |
|
MD5 | b9bc298fbc950e2fa4b805d4142cee74 |
|
BLAKE2b-256 | 7e95832d1183cea93ff558343426fb94fca69709072b2dda0be9803faf16af93 |
Hashes for greenlet-0.4.6-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 656c36362701f81ed1e059a1ecae726cb6a623d55226f6c162160ee79c3379d8 |
|
MD5 | 1ad4147209842aa6680931b45b8883e9 |
|
BLAKE2b-256 | f5c195ff5c29713e11371ec43ff4e1ae3a6a33faa78154c6f294411c182a17c5 |
Hashes for greenlet-0.4.6-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1926bf063235af7ef960505610720be96b2e17ab7c22d706adb565a0d3d6178 |
|
MD5 | 5b043131bd5299a6e85d53f3a5c6f514 |
|
BLAKE2b-256 | a8963a5e0653c9ca4c0bf306c946d078d6118ad7257e1092f1c6f0472423bb92 |
Hashes for greenlet-0.4.6-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e641e10392e9fd49defc82c6574341f9540faf85d773d0396287d2fa4891f62 |
|
MD5 | d346daa0256e7491095b611ce59d8f87 |
|
BLAKE2b-256 | c5bd1621f7373a16e7aa521f44b1c04e3ef2c08c5cf46caa11d6b9906478f62b |
Hashes for greenlet-0.4.6-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b9a6032f39ff75ed93144e716b439a4120b982baee389b60173fe375830061 |
|
MD5 | b52c77e3dc645eb8a695908152de3e08 |
|
BLAKE2b-256 | 31a1031549ab38992b49457ca7937d1b47a862dce8b1dcbd42791c1b49ee7922 |
Hashes for greenlet-0.4.6-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72f0c3962c95dc22ab07506f21f1f8e9c5f8060f5dd625d6fc3e381cb097bde9 |
|
MD5 | a85ab3718f0a2348bcdc7078af0100f7 |
|
BLAKE2b-256 | ed04bbded6c51b49c6146704eb96d80b60684528be33e2c4c1647f4e85b26bf0 |
Hashes for greenlet-0.4.6-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6c3c9076c3ce0868de4904b32d6738fa8fa73fb051b565b38fe19c5ab254e09 |
|
MD5 | 4b5fc7755ab68642d3c93bf7a52454ac |
|
BLAKE2b-256 | 914077e3e2b5ca3ec491679b1e3f8a4b17dc8d75e896342721eaf7a29f871f51 |
Hashes for greenlet-0.4.6-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1682107ba783a8c10b94648785b5a87f952ce8f91985ea2244a19b120174d799 |
|
MD5 | 928d742eccef73ab2b87a5423088be0a |
|
BLAKE2b-256 | c5e1d3ea2bdfb0db555e23182f8718e41f643fc1effd73c92c846661f853df08 |
Hashes for greenlet-0.4.6-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4e9e045744176d49daae6cff7c2c3752967ee79b8febaa2bdc4edaf4b32a8b3 |
|
MD5 | 3a6bf4607c7fc12910d4000e38bedfcb |
|
BLAKE2b-256 | cbb1eaf0ab845b70a1de9afa88d1881972fea48b64bb823d8a90991d677422a8 |
Hashes for greenlet-0.4.6-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12df47e97cc363408582669d5259a33b72c5910b352eef90f640d2fa3589b15a |
|
MD5 | c4a1d692f2a9d7e7c931d4cbb4be71c7 |
|
BLAKE2b-256 | 6b9252d1f2b91d47be38a93b771b1a7bf602f6376577aab1f749ce016aa102d6 |