Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/workflows/ | H | 29-Sep-2021 | - | 131 | 121 | |
appveyor/ | H | 29-Sep-2021 | - | 319 | 277 | |
benchmarks/ | H | 29-Sep-2021 | - | 40 | 28 | |
docs/ | H | 29-Sep-2021 | - | 2,296 | 1,604 | |
src/ | H | 29-Sep-2021 | - | 6,568 | 4,449 | |
.clang-format | H A D | 29-Sep-2021 | 697 | 30 | 23 | |
.readthedocs.yml | H A D | 29-Sep-2021 | 439 | 20 | 16 | |
AUTHORS | H A D | 29-Sep-2021 | 849 | 52 | 50 | |
CHANGES.rst | H A D | 29-Sep-2021 | 9.5 KiB | 289 | 241 | |
LICENSE | H A D | 29-Sep-2021 | 1.4 KiB | 31 | 23 | |
LICENSE.PSF | H A D | 29-Sep-2021 | 2.4 KiB | 48 | 39 | |
MANIFEST.in | H A D | 29-Sep-2021 | 792 | 49 | 40 | |
PKG-INFO | H A D | 29-Sep-2021 | 4.2 KiB | 99 | 79 | |
README.rst | H A D | 29-Sep-2021 | 2.2 KiB | 62 | 43 | |
appveyor.yml | H A D | 29-Sep-2021 | 6.1 KiB | 183 | 152 | |
make-manylinux | H A D | 29-Sep-2021 | 1.5 KiB | 53 | 32 | |
setup.cfg | H A D | 29-Sep-2021 | 125 | 9 | 6 | |
setup.py | H A D | 29-Sep-2021 | 5.7 KiB | 161 | 124 | |
tox.ini | H A D | 29-Sep-2021 | 716 | 30 | 25 |
README.rst
1.. This file is included into docs/history.rst 2 3.. image:: https://github.com/python-greenlet/greenlet/workflows/tests/badge.svg 4 :target: https://github.com/python-greenlet/greenlet/actions 5 6Greenlets are lightweight coroutines for in-process concurrent 7programming. 8 9The "greenlet" package is a spin-off of `Stackless`_, a version of 10CPython that supports micro-threads called "tasklets". Tasklets run 11pseudo-concurrently (typically in a single or a few OS-level threads) 12and are synchronized with data exchanges on "channels". 13 14A "greenlet", on the other hand, is a still more primitive notion of 15micro-thread with no implicit scheduling; coroutines, in other words. 16This is useful when you want to control exactly when your code runs. 17You can build custom scheduled micro-threads on top of greenlet; 18however, it seems that greenlets are useful on their own as a way to 19make advanced control flow structures. For example, we can recreate 20generators; the difference with Python's own generators is that our 21generators can call nested functions and the nested functions can 22yield values too. (Additionally, you don't need a "yield" keyword. See 23the example in `test_generator.py 24<https://github.com/python-greenlet/greenlet/blob/adca19bf1f287b3395896a8f41f3f4fd1797fdc7/src/greenlet/tests/test_generator.py#L1>`_). 25 26Greenlets are provided as a C extension module for the regular unmodified 27interpreter. 28 29.. _`Stackless`: http://www.stackless.com 30 31 32Who is using Greenlet? 33====================== 34 35There are several libraries that use Greenlet as a more flexible 36alternative to Python's built in coroutine support: 37 38 - `Concurrence`_ 39 - `Eventlet`_ 40 - `Gevent`_ 41 42.. _Concurrence: http://opensource.hyves.org/concurrence/ 43.. _Eventlet: http://eventlet.net/ 44.. _Gevent: http://www.gevent.org/ 45 46Getting Greenlet 47================ 48 49The easiest way to get Greenlet is to install it with pip:: 50 51 pip install greenlet 52 53 54Source code archives and binary distributions are vailable on the 55python package index at https://pypi.org/project/greenlet 56 57The source code repository is hosted on github: 58https://github.com/python-greenlet/greenlet 59 60Documentation is available on readthedocs.org: 61https://greenlet.readthedocs.io 62