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.5-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9cd0d764331e40489fcc453e0450331d8e6be56706c8ee7c1bfa1c7a6c2f63 |
|
MD5 | 960c3c8a716b60f4612c107cd7798d0e |
|
BLAKE2b-256 | ef04b13c59cb001453657c36ba0794573f51192196a4cb970f8f7baca3490196 |
Hashes for greenlet-0.4.5-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 693cc0a8cdc5e4e935282c3a41e80ed66c450537b4b3f3e121ae409226a46bab |
|
MD5 | f2e6a03a70646c4287a339a67bc2fab8 |
|
BLAKE2b-256 | 63d43f8c86938ea24913d24171f647bc3bf0ff8ca09110c9f0158e4158918687 |
Hashes for greenlet-0.4.5-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eaadfe7ce3a615280f225751c3de2b87d935de6b35d5970ca4ed99cdad2fe91 |
|
MD5 | 72f1c9b7a8f89e359fb3bc2ff3104e16 |
|
BLAKE2b-256 | 73b934fd3e9f89e17274f990d21cda749bc9156f4e772b88c833f29be324f038 |
Hashes for greenlet-0.4.5-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37a2bdaeaf009cf1ab2d8b5b076951af294194e6a7f91f981631a402e8a3f211 |
|
MD5 | 065cb1fa3fe52eeeb52c8084b8a126a4 |
|
BLAKE2b-256 | 49fa10217d71cf0520a636e477c2bd7da2ed48424515c479de9f0920f4d3fc2d |
Hashes for greenlet-0.4.5-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d40b8c501fa38b41b4b03c9ffcb2b0cb4c41363576737fadf71a68664880ac |
|
MD5 | ecdb435c388119b5ea4e51e20d2f551c |
|
BLAKE2b-256 | 4e73b96906c4b589a5079552be64b7daa0a643a887579d53d8c0f9334114de44 |
Hashes for greenlet-0.4.5-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6aeee2ad55b7c33090e20689ce00cf9db2e3c482f93c41971a97ba0dcb90348 |
|
MD5 | 15142bd2fc154ef84d36c460f5a65beb |
|
BLAKE2b-256 | db4ac03a6e17c96118234bdf3008b751ef9133f25ce139fce6208c108c086785 |
Hashes for greenlet-0.4.5-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6130a826f1b956d740009992b0af4ef1f4820bffec85db1e46f8e6d50776f1af |
|
MD5 | 23486ab721e1c0976ffb10c10ee2679b |
|
BLAKE2b-256 | 4dcf302a7c69291f44aaa7282213dceabad170c598c0c1fc0cee9080ecf08980 |
Hashes for greenlet-0.4.5-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f2c5b7edb421c44a50e33243af1179257975712ab0abdb2312d03b5b3b5558f |
|
MD5 | 9e53c9d3be3e711c9bc8d577ab9b0ebc |
|
BLAKE2b-256 | 7ea389e3096c16e4cd8195229689f52aea429aa62d58e5ab17181c3daf490674 |
Hashes for greenlet-0.4.5-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61e68c282ac17a1c8aacd9210d799968e6fe6d2dee4f890f30936596a19b8062 |
|
MD5 | e06ab7f742a642b7d5b490c90521d0fc |
|
BLAKE2b-256 | 006b9d4b5faa314ac579fda43f874b69246f9d7d1635a39f02c5d5f8866f04e6 |
Hashes for greenlet-0.4.5-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b51d4da52ddd32eee15ded8a067bebfd2a240eb76205b724f758cb846102be5b |
|
MD5 | 061bf912a0bba911e590c731ddb878b0 |
|
BLAKE2b-256 | 7973736dea1f7bdb982fda8c0d5258d54d3226365c6f9f58846f471945c6c004 |
Hashes for greenlet-0.4.5-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a340ac1719633803bf5631ccb0b0cf52ab4a5afbc66e10a7838f30fa27466a0 |
|
MD5 | c684e5e4b5225c99c988f8fa84e676b3 |
|
BLAKE2b-256 | e5e4b42d16b025fbe8912ed808497f33acaefdc6173f59004307b0d10e52a1e2 |
Hashes for greenlet-0.4.5-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2babaeaa29d461e4db101f5bcf3a1a4f24eb5b5a173395355b9ceffd17cf0d47 |
|
MD5 | 021b9b3b5e06fc3b9cd65c0bb5aeaac1 |
|
BLAKE2b-256 | c3dfb7dc66720cf4c295ecc67e4be20281de7a5584d6050c5f065990353775e1 |