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 Distributions
Built Distributions
Hashes for greenlet-0.4.9-py3.5-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13d1eaf9fa7a9dfb3bd8e33818f1b3799bc5bdd9a808744210bc4d3e45f70b2 |
|
MD5 | ce75ce80a124a369742d331e45ab00f3 |
|
BLAKE2b-256 | c15ba32744618282125456b5f8f3e02b643791b5276bb3819b3bc94f8b0b6c1b |
Hashes for greenlet-0.4.9-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 696a2697fdc28c2704e94e7d801d1eb3bcaaff3dbdbd1129bf40e6ab3dd35f62 |
|
MD5 | 04da6368fe648a994ff1591cb7c3e1fd |
|
BLAKE2b-256 | 2983db690d1100a64dd1d6590060e5d30cba9531af23eb8240b9bf98dfccd854 |
Hashes for greenlet-0.4.9-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9abaaa5f00326a8e0fbb31f7835cc8527196fec8514e7bd5ea76d0a55e7f6107 |
|
MD5 | b42140aa7f85ce895b7a12742cb4ceb0 |
|
BLAKE2b-256 | 888f411f927e3bc9da424021fb3cdba6487e7242f22a54cfc7579d4aa2e81de1 |
Hashes for greenlet-0.4.9-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca8f59589e3acedb29464a92552c59eb192aec8708d8075cfd291ce21b4a54a1 |
|
MD5 | 3449dcbdee3d387d1f065f1fd2f6eb88 |
|
BLAKE2b-256 | 1694cda5ff0e28f53b33ab2ec6af039b594bd607b1fbe098231c9762cdd694b1 |
Hashes for greenlet-0.4.9-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d4a900ab2f01d72697486e7774c156f587f4f11dc1a1f2498bba8ce6776e84a |
|
MD5 | 233d1cb9759453fcdec95bdec5ef0574 |
|
BLAKE2b-256 | 819d281dfedbae76e66982ce4807610431bce7f935857872032d6bab5b4d4c34 |
Hashes for greenlet-0.4.9-cp35-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d48cbff2758ded71192f486a026815c975a7589d0d78d0cd8f7f5045b44b540 |
|
MD5 | 0f807dc692bb00827c5eadf7484aedb4 |
|
BLAKE2b-256 | 2fb6673073edebea59b9acfa9fa9a5bc474da3bfe58ae7912f0d5b3241bcdaa6 |
Hashes for greenlet-0.4.9-cp35-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11f6fbb16df0fd595fec0b61e88f45f3d59cd8940db2f218de272c7702ec32b6 |
|
MD5 | 3b2f9b9801953a4c83b97da3901f2b08 |
|
BLAKE2b-256 | b618a9081c41106ed7d6aa76d329411400caab8c35e915ba5903090a94f4bdcf |
Hashes for greenlet-0.4.9-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2fa73c6ad6329eada2794d96d91770d1aa3c47765dd07b5195fd038f1b93be2 |
|
MD5 | d32e0c88b1e43a0ee78f43e7ef6bfd4a |
|
BLAKE2b-256 | 2b234071e3b2fad0e1ba57604d16f92cce277216c130dfaba29b856e2dd27944 |
Hashes for greenlet-0.4.9-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bfac4f247485128229a9e599515945b5651d8ea7a18a798d856231f166d574b |
|
MD5 | ec60d0596d7dc65be0286e5a308c0f80 |
|
BLAKE2b-256 | 274fa6fe0d2d522286421bd2c5055baf489ed463fa27c66941b246289a9392d3 |
Hashes for greenlet-0.4.9-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 114cd3c54cb0b09fc8453fba9e4461d372795f47783f46287438dd0db6c71901 |
|
MD5 | 5d4d565b68853a82edf05cf0139ddd85 |
|
BLAKE2b-256 | 05dfb0594bc8950867168be19020be5c0e6ad518d1df5f239810dde2fbd27bb2 |
Hashes for greenlet-0.4.9-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa84641f4def24b92f1a9b307a9c4fc74df7ee4ac1bf6a3b13e0d35ced7e794 |
|
MD5 | 7c45ed5a5f24968999eb6da6b3c5fddd |
|
BLAKE2b-256 | 1e35234d7d43f60ee2143806cc96035a907d0d58d442df9bf68eb7650a0d178e |
Hashes for greenlet-0.4.9-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92ddce276d395323188f16454942a2e2977206278a9f21d71fb1684282880f5 |
|
MD5 | 546bde382b5806f2f952ce872573cb57 |
|
BLAKE2b-256 | cffa9059ad0416b34313e56881b83c9ed413423ac08b4000b7940506b090f1b0 |
Hashes for greenlet-0.4.9-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ead5fddb863c1a16e57c23b39241b5e44e612100a568c1170cfb847458e35a6f |
|
MD5 | 38ef4c14f58a1da74043f772fb2ed3f6 |
|
BLAKE2b-256 | dff6487609c4de9fe0285f38f56b11c716f1a0ca393d9a4cea8362a87ed0d67d |
Hashes for greenlet-0.4.9-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6da8c3c42159ae7ad6f2d90cd8cba53530e94e796d7636c49c827b19346b1b5b |
|
MD5 | 8b724bc7da5bceaa973cb51eb8d65fa9 |
|
BLAKE2b-256 | 96faa69de426d983fe3c5089e8f6668044fe034c13485116989e1f77623f2dc0 |
Hashes for greenlet-0.4.9-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddbf30efe72a290e092a225968d6bcd6648d275a628f5e351367808311a2fd64 |
|
MD5 | 820cf216a670783384af71918d789456 |
|
BLAKE2b-256 | be6f1cca14c2a43ec8a68c3525f3e5e711b130ca6f9e13b5ed22e94043fe4f8f |