fibers-ddtest


Namefibers-ddtest JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttp://github.com/saghul/python-fibers
SummaryLightweight cooperative microthreads for Pyhton
upload_time2023-10-30 05:38:44
maintainer
docs_urlNone
authorSaúl Ibarra Corretgé
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ===========================================
fibers: lightweight concurrent multitasking
===========================================

.. image:: https://badge.fury.io/py/fibers.png
    :target: http://badge.fury.io/py/fibers

Overview
========

Fibers are lightweight primitives for cooperative multitasking in Python. They
provide means for running pieces of code that can be paused and resumed. Unlike
threads, which are preemptively scheduled, fibers are scheduled cooperatively,
that is, only one fiber will be running at a given point in time, and no other
fiber will run until the user explicitly decides so.

When a fiber is created it will not run automatically. A fiber must be 'switched'
into for it to run. Fibers can switch control to other fibers by way of the `switch`
or `throw` functions, which switch control or raise and exception in the target
fiber respectively.

Example:

::

    import fibers

    def func1():
        print "1"
        f2.switch()
        print "3"
        f2.switch()

    def func2():
        print "2"
        f1.switch()
        print "4"

    f1 = fibers.Fiber(target=func1)
    f2 = fibers.Fiber(target=func2)
    f1.switch()


The avove example will print "1 2 3 4", but the result was obtained by the
cooperative work of 2 fibers yielding control to each other.


CI status
=========

::target: https://github.com/saghul/python-fibers/actions/


Documentation
=============

http://readthedocs.org/docs/python-fibers/


Installing
==========

fibers can be installed via pip as follows:

::

    pip install fibers


Building
========

Get the source:

::

    git clone https://github.com/saghul/python-fibers


Linux:

::

    ./build_inplace

Mac OSX:

::

    (XCode needs to be installed)
    export ARCHFLAGS="-arch x86_64"
    ./build_inplace

Microsoft Windows:

::

    python setup.py build_ext --inplace


Running the test suite
======================

The test suite can be run using nose:

::

    nosetests -v


Author
======

Saúl Ibarra Corretgé <saghul@gmail.com>

This project would not have been possible without the previous work done in
the `greenlet <http://greenlet.readthedocs.org>`_ and stacklet (part of
`PyPy <http://pypy.org>`_) projects.


License
=======

Unless stated otherwise on-file fibers uses the MIT license, check LICENSE file.


Supported Python versions
=========================

Python >= 3.5 are supported. Other older Python versions might work, but
they are not actively tested. CPython and PyPy are supported.


Supported architectures
=======================

x86, x86-64, ARM, MIPS64, PPC64 and s390x are supported.


Contributing
============

If you'd like to contribute, fork the project, make a patch and send a pull
request. Have a look at the surrounding code and please, make yours look
alike.




            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/saghul/python-fibers",
    "name": "fibers-ddtest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sa\u00fal Ibarra Corretg\u00e9",
    "author_email": "saghul@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/de/5a/90859589a55e36490dd481218eba0f293da2a85d81e4fe1db977235fbdd7/fibers-ddtest-1.2.0.tar.gz",
    "platform": "POSIX",
    "description": "===========================================\nfibers: lightweight concurrent multitasking\n===========================================\n\n.. image:: https://badge.fury.io/py/fibers.png\n    :target: http://badge.fury.io/py/fibers\n\nOverview\n========\n\nFibers are lightweight primitives for cooperative multitasking in Python. They\nprovide means for running pieces of code that can be paused and resumed. Unlike\nthreads, which are preemptively scheduled, fibers are scheduled cooperatively,\nthat is, only one fiber will be running at a given point in time, and no other\nfiber will run until the user explicitly decides so.\n\nWhen a fiber is created it will not run automatically. A fiber must be 'switched'\ninto for it to run. Fibers can switch control to other fibers by way of the `switch`\nor `throw` functions, which switch control or raise and exception in the target\nfiber respectively.\n\nExample:\n\n::\n\n    import fibers\n\n    def func1():\n        print \"1\"\n        f2.switch()\n        print \"3\"\n        f2.switch()\n\n    def func2():\n        print \"2\"\n        f1.switch()\n        print \"4\"\n\n    f1 = fibers.Fiber(target=func1)\n    f2 = fibers.Fiber(target=func2)\n    f1.switch()\n\n\nThe avove example will print \"1 2 3 4\", but the result was obtained by the\ncooperative work of 2 fibers yielding control to each other.\n\n\nCI status\n=========\n\n::target: https://github.com/saghul/python-fibers/actions/\n\n\nDocumentation\n=============\n\nhttp://readthedocs.org/docs/python-fibers/\n\n\nInstalling\n==========\n\nfibers can be installed via pip as follows:\n\n::\n\n    pip install fibers\n\n\nBuilding\n========\n\nGet the source:\n\n::\n\n    git clone https://github.com/saghul/python-fibers\n\n\nLinux:\n\n::\n\n    ./build_inplace\n\nMac OSX:\n\n::\n\n    (XCode needs to be installed)\n    export ARCHFLAGS=\"-arch x86_64\"\n    ./build_inplace\n\nMicrosoft Windows:\n\n::\n\n    python setup.py build_ext --inplace\n\n\nRunning the test suite\n======================\n\nThe test suite can be run using nose:\n\n::\n\n    nosetests -v\n\n\nAuthor\n======\n\nSa\u00fal Ibarra Corretg\u00e9 <saghul@gmail.com>\n\nThis project would not have been possible without the previous work done in\nthe `greenlet <http://greenlet.readthedocs.org>`_ and stacklet (part of\n`PyPy <http://pypy.org>`_) projects.\n\n\nLicense\n=======\n\nUnless stated otherwise on-file fibers uses the MIT license, check LICENSE file.\n\n\nSupported Python versions\n=========================\n\nPython >= 3.5 are supported. Other older Python versions might work, but\nthey are not actively tested. CPython and PyPy are supported.\n\n\nSupported architectures\n=======================\n\nx86, x86-64, ARM, MIPS64, PPC64 and s390x are supported.\n\n\nContributing\n============\n\nIf you'd like to contribute, fork the project, make a patch and send a pull\nrequest. Have a look at the surrounding code and please, make yours look\nalike.\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Lightweight cooperative microthreads for Pyhton",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "http://github.com/saghul/python-fibers"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "de5a90859589a55e36490dd481218eba0f293da2a85d81e4fe1db977235fbdd7",
                "md5": "a4a024c35a09632d6b100d095215e6f4",
                "sha256": "3b415c08e3d3b9833564cfd9ec5d30e49d4b13195a815d63a9951525cacbd47b"
            },
            "downloads": -1,
            "filename": "fibers-ddtest-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a4a024c35a09632d6b100d095215e6f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 35374,
            "upload_time": "2023-10-30T05:38:44",
            "upload_time_iso_8601": "2023-10-30T05:38:44.081448Z",
            "url": "https://files.pythonhosted.org/packages/de/5a/90859589a55e36490dd481218eba0f293da2a85d81e4fe1db977235fbdd7/fibers-ddtest-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 05:38:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "saghul",
    "github_project": "python-fibers",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "appveyor": true,
    "lcname": "fibers-ddtest"
}
        
Elapsed time: 0.20730s