Make C module compatible with gevent at runtime.
Project description
greenify can make Python extension modules having network operations in C code to be compatible with gevent.
greenify uses the Dynamic Function Redirecting technique same as ELF-Hook to patch blocking network operations at runtime, without the need modify the original modules.
Currently greenify only supports ELF format modules, and is tested on Linux.
Build status
Install from source
greenify module is installed using setuptools or pip:
python setup.py install
or:
pip install greenify
Usage
Thread Safety
Once activated, the green C functions will, on potentially blocking operation, pass control to gevent’s main event loop, which may switch to other ready greenlet which is also in one of the green functions. So, make sure your C code can handle this kind of execution pause and resume. A thread safe program usually is ready for greenify, but remember that all the switches happen in a single thread.
License
greenify is written and maintained by douban and is licensed under New BSD license.
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 greenify-0.3.4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5a1531550355eaca8168238aa2afe39b6ef19d5c55db69f8cb46eb5d5bc9785 |
|
MD5 | 041378d6455d3be15a22a7ee33f3214c |
|
BLAKE2b-256 | 5e8d39963d56749ca8e83a5969f0e8db94d2be35de1174e8549fa8094d10935e |
Hashes for greenify-0.3.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccd9f53db127c5953d29869bc39e941fc800079dba080851058edbb4437c534c |
|
MD5 | 633e3c1d0516b142c5d59d17fa55b3a6 |
|
BLAKE2b-256 | 7f711e329dde62b4eb37c65f783a6555ad7ce507eccc29b04d54d7629ca44af7 |
Hashes for greenify-0.3.4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 336bfb184417eab44effdd1982c25e9d52ab23575e814ef33a856545ab2928da |
|
MD5 | d42a11ed49da125b87f08920865654b1 |
|
BLAKE2b-256 | d3c42ae4684021f8dab804abcd5facfefbeba03f346f5eb2f408bef684d3a02f |
Hashes for greenify-0.3.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b580bd54e15b51b9e840015501b4bdc279fa52474c1a0ef2dee04298c7cf1fc |
|
MD5 | 1f25f850b82f567a8e0b46c01689602d |
|
BLAKE2b-256 | d0fa6b238790dee09912d42b8dec17bd43e32eff56d8d157efc5a5007e102341 |
Hashes for greenify-0.3.4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9dfd81d3fdbf65882d08ef660188d60bc01f28c4bb8b685697d659631d9c875 |
|
MD5 | a190e36e952b9c604f73083ed44d3ab3 |
|
BLAKE2b-256 | d402c183d22c96ab993431a7012c3b80999f883345ebd71b0442214555bc84dc |
Hashes for greenify-0.3.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d52e46beb032f2490f9514718b75deff1444c09841fa044db1ce8c3d0c28ced |
|
MD5 | b67f14cdbe68aa2d02e2719a24c764cb |
|
BLAKE2b-256 | 342ddb477201fbce9873b3f3ebcd1833615d446712d45b9581b9096ff0860d1f |
Hashes for greenify-0.3.4-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18412ca155408d2296122fc91c8a4132b61223801d0f2c02b7076df6414581b7 |
|
MD5 | 588d2b8d868070fa6bd97c5b5e881a18 |
|
BLAKE2b-256 | 55ba53ca7f2c9a2ffb849aee970b0995ddeb9b384d46902cafe7f2377bb738b3 |
Hashes for greenify-0.3.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff7ea81473cfe02aa4c932ebdfa520537715ce70a293b60b3583ec0bbbdaaea0 |
|
MD5 | 87432f4ab9065a4d38245807137c3ea7 |
|
BLAKE2b-256 | 1bb3be03511b905110be46675569a8d74d967baec15385cc2413bf7dd1b7ea0b |
Hashes for greenify-0.3.4-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f3781e8335dab2d82bbc2e36c2aa372dd8c1a969b19396c855574782e01509 |
|
MD5 | 0276395dc57e5411ab7547a6ec5cb51b |
|
BLAKE2b-256 | 4906ae36a711fb187babf939a42049653286a895578bc319b76fe6e6623120a6 |
Hashes for greenify-0.3.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 265cb77dc452998466c4e7a1770a1a681fcf318738dd27167b3ff80460d5e074 |
|
MD5 | 5a9520a97bf7ef0e0411dd0ba2fe92fa |
|
BLAKE2b-256 | 5386638c322d4c02e2352f460334f69e821afe39664517b210852ae8e2e7e55e |
Hashes for greenify-0.3.4-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86f8592798998936bdba6cc48e005cdf2c667f2ba5c8901e68aa0f74d67a3786 |
|
MD5 | a263c7e924bee9e58fd03029a7f9aead |
|
BLAKE2b-256 | 2a0d34be45effa5441e0ec241dbc707e698f1419c927c0672794f12e06fe36eb |
Hashes for greenify-0.3.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e1f50a159016ab4ec10b3ae18e098c1ea66b36a530b2b85a8bdf3cbb4793350 |
|
MD5 | 6a6852f2f1a8c121decdbbe07bb1978b |
|
BLAKE2b-256 | 88944c6bbf7fc150a6f1b7a2873d95bddec5345eec2b90b7efb3411e7fde1041 |