{"id":13482238,"url":"https://github.com/quantmind/pulsar","last_synced_at":"2025-09-28T21:30:55.467Z","repository":{"id":62578275,"uuid":"1257514","full_name":"quantmind/pulsar","owner":"quantmind","description":"Event driven concurrent framework for Python","archived":true,"fork":false,"pushed_at":"2019-12-27T05:13:22.000Z","size":47638,"stargazers_count":1868,"open_issues_count":29,"forks_count":162,"subscribers_count":92,"default_branch":"master","last_synced_at":"2024-05-21T01:03:07.963Z","etag":null,"topics":["asyncio","greenlet","http","http-server","multiprocessing","python","rpc","test-framework","wsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quantmind.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-15T12:10:13.000Z","updated_at":"2024-04-17T21:18:36.000Z","dependencies_parsed_at":"2022-11-03T21:00:38.985Z","dependency_job_id":null,"html_url":"https://github.com/quantmind/pulsar","commit_stats":null,"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantmind%2Fpulsar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantmind%2Fpulsar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantmind%2Fpulsar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantmind%2Fpulsar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quantmind","download_url":"https://codeload.github.com/quantmind/pulsar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234563140,"owners_count":18853060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","greenlet","http","http-server","multiprocessing","python","rpc","test-framework","wsgi"],"created_at":"2024-07-31T17:01:00.172Z","updated_at":"2025-09-28T21:30:55.395Z","avatar_url":"https://github.com/quantmind.png","language":"Python","readme":".. image:: https://fluidily-public.s3.amazonaws.com/pulsar/images/pulsar-banner-600.svg\n   :alt: Pulsar\n   :width: 300\n\n|\n|\n\n:Badges: |license|  |pyversions| |status| |pypiversion| |contributors|\n:CI: |circleci| |coverage| |appveyor| |travis| |docs|\n:Documentation: https://docs.pulsarweb.org\n:Downloads: http://pypi.python.org/pypi/pulsar\n:Source: https://github.com/quantmind/pulsar\n:Benchmarks: https://bench.pulsarweb.org/\n:Chat channel: `Riot.im room`_\n:Mailing list: `google user group`_\n:Stack overflow: questions tagged python-pulsar_\n:Design by: `Quantmind`_ and `Luca Sbardella`_\n:Platforms: Linux, OSX, Windows. Python 3.5 and above\n:Keywords: python, asyncio, multiprocessing, client/server, asynchronous, concurrency, actor, thread, process, socket, wsgi, websocket, redis, json-rpc\n\n.. |pypiversion| image:: https://img.shields.io/pypi/v/pulsar.svg\n    :target: https://pypi.python.org/pypi/pulsar\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/pulsar.svg\n  :target: https://pypi.python.org/pypi/pulsar\n.. |license| image:: https://img.shields.io/pypi/l/pulsar.svg\n  :target: https://pypi.python.org/pypi/pulsar\n.. |status| image:: https://img.shields.io/pypi/status/pulsar.svg\n  :target: https://pypi.python.org/pypi/pulsar\n.. |downloads| image:: https://img.shields.io/pypi/dd/pulsar.svg\n  :target: https://pypi.python.org/pypi/pulsar\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/w2ip01j07qm161ei?svg=true\n    :target: https://ci.appveyor.com/project/lsbardel/pulsar\n.. |contributors| image:: https://img.shields.io/github/contributors/quantmind/pulsar.svg\n    :target: https://github.com/quantmind/pulsar/graphs/contributors\n.. |circleci| image:: https://circleci.com/gh/quantmind/pulsar.svg?style=svg\n    :target: https://circleci.com/gh/quantmind/pulsar\n.. |coverage| image:: https://codecov.io/gh/quantmind/pulsar/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/quantmind/pulsar\n.. |travis| image:: https://api.travis-ci.org/quantmind/pulsar.svg?branch=release\n  :target: https://travis-ci.org/quantmind/pulsar\n.. |docs| image:: https://media.readthedocs.org/static/projects/badges/passing.svg\n  :target: https://docs.pulsarweb.org\n\nAn example of a web server written with ``pulsar`` which responds with\n\"Hello World!\" for every request:\n\n.. code:: python\n\n    from pulsar.apps import wsgi\n\n    def hello(environ, start_response):\n        data = b'Hello World!\\n'\n        response_headers = [\n            ('Content-type','text/plain'),\n            ('Content-Length', str(len(data)))\n        ]\n        start_response('200 OK', response_headers)\n        return [data]\n\n\n    if __name__ == '__main__':\n        wsgi.WSGIServer(callable=hello).start()\n\n\nPulsar's goal is to provide an easy way to build scalable network programs.\nIn the ``Hello world!`` web server example above, many client\nconnections can be handled concurrently.\nPulsar tells the operating system (through epoll or select) that it should be\nnotified when a new connection is made, and then it goes to sleep.\n\nPulsar uses the asyncio_ module from the standard python\nlibrary and it can be configured to run in multi-processing mode.\n\nAnother example of pulsar framework is the asynchronous HttpClient_:\n\n.. code:: python\n\n    from pulsar.apps import http\n\n    async with http.HttpClient() as session:\n        response1 = await session.get('https://github.com/timeline.json')\n        response2 = await session.get('https://api.github.com/emojis.json')\n\n\nThe http client maintains connections alive (by default 15 seconds) and therefore\nany requests that you make within a session will automatically reuse the\nappropriate connection. All connections are released once the session exits the\nasynchronous ``with`` block.\n\nInstalling\n============\n\nPulsar has one **hard dependency**:\n\n* multidict_\n\ninstall via pip::\n\n    pip install pulsar\n\nor download the tarball from pypi_.\n\nTo speedup pulsar by a factor of 2 or more these **soft dependencies** are recommended\n\n* httptools_\n* uvloop_\n\nApplications\n==============\nPulsar design allows for a host of different asynchronous applications\nto be implemented in an elegant and efficient way.\nOut of the box it is shipped with the the following:\n\n* Socket servers\n* `Asynchronous WSGI server`_\n* HttpClient_\n* JSON-RPC_\n* `Web Sockets`_\n* `Asynchronous Test suite`_\n* `Data stores`_ (with async Redis client)\n* `Task queue consumers`_\n* `Asynchronous botocore`_\n* `django integration`_\n\n.. _examples:\n\nExamples\n=============\nCheck out the ``examples`` directory for various working applications.\nIt includes:\n\n* Hello world! wsgi example\n* An Httpbin WSGI application\n* An HTTP Proxy server\n* A JSON-RPC Calculator server\n* Websocket random graph.\n* Websocket chat room.\n* The `dining philosophers problem \u003chttp://en.wikipedia.org/wiki/Dining_philosophers_problem\u003e`_.\n* `Twitter streaming \u003chttps://github.com/quantmind/pulsar-twitter\u003e`_\n\n\nDesign\n=============\nPulsar internals are based on `actors primitive`_. ``Actors`` are the *atoms*\nof pulsar's concurrent computation, they do not share state between them,\ncommunication is achieved via asynchronous inter-process message passing,\nimplemented using the standard python socket library.\n\nTwo special classes of actors are the ``Arbiter``, used as a singleton_,\nand the ``Monitor``, a manager of several actors performing similar functions.\nThe Arbiter runs the main eventloop and it controls the life of all actors.\nMonitors manage group of actors performing similar functions, You can think\nof them as a pool of actors.\n\n.. image:: https://fluidily-public.s3.amazonaws.com/pulsar/images/actors.png\n   :alt: Pulsar Actors\n\nMore information about design and philosophy in the documentation.\n\n\nAdd-ons\n=========\nPulsar checks if some additional libraries are available at runtime, and\nuses them to add additional functionalities or improve performance:\n\n* greenlet_: required by the `pulsar.apps.greenio`_ module and useful for\n  developing implicit asynchronous applications\n* uvloop_: if available it is possible to use it as the default event loop\n  for actors by passing ``--io uv`` in the command line (or ``event_loop=\"uv\"``\n  in the config file)\n* httptools_: if available, the default Http Parser for both client and server\n  is replaced by the C implementation in this package\n* setproctitle_: if installed, pulsar can use it to change the processes names\n  of the running application\n* psutil_: if installed, a ``system`` key is available in the dictionary\n  returned by Actor info method\n* python-certifi_: The HttpClient_ will attempt to use certificates from\n  certifi if it is present on the system\n* ujson_: if installed it is used instead of the native ``json`` module\n* unidecode_: to enhance the ``slugify`` function\n\n\nRunning Tests\n==================\nPulsar test suite uses the pulsar test application. To run tests::\n\n    python setup.py test\n\nFor options and help type::\n\n    python setup.py test --help\n\nflake8_ check (requires flake8 package)::\n\n    flake8\n\n\n.. _contributing:\n\nContributing\n=================\nDevelopment of pulsar_ happens at Github. We very much welcome your contribution\nof course. To do so, simply follow these guidelines:\n\n* Fork pulsar_ on github\n* Create a topic branch ``git checkout -b my_branch``\n* Push to your branch ``git push origin my_branch``\n* Create an issue at https://github.com/quantmind/pulsar/issues with\n  pull request for the **dev branch**.\n* Alternatively, if you need to report a bug or an unexpected behaviour, make sure\n  to include a mcve_ in your issue.\n\nA good ``pull`` request should:\n\n* Cover one bug fix or new feature only\n* Include tests to cover the new code (inside the ``tests`` directory)\n* Preferably have one commit only (you can use rebase_ to combine several\n  commits into one)\n* Make sure ``flake8`` tests pass\n\n.. _license:\n\nLicense\n=============\nThis software is licensed under the BSD_ 3-clause License. See the LICENSE\nfile in the top distribution directory for the full license text.\n\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\n.. _multiprocessing: http://docs.python.org/library/multiprocessing.html\n.. _`actors primitive`: http://en.wikipedia.org/wiki/Actor_model\n.. _setproctitle: http://code.google.com/p/py-setproctitle/\n.. _psutil: https://github.com/giampaolo/psutil\n.. _pypi: http://pypi.python.org/pypi/pulsar\n.. _BSD: http://opensource.org/licenses/BSD-3-Clause\n.. _pulsar: https://github.com/quantmind/pulsar\n.. _singleton: http://en.wikipedia.org/wiki/Singleton_pattern\n.. _cython: http://cython.org/\n.. _`google user group`: https://groups.google.com/forum/?fromgroups#!forum/python-pulsar\n.. _flake8: https://pypi.python.org/pypi/flake8\n.. _ujson: https://pypi.python.org/pypi/ujson\n.. _rebase: https://help.github.com/articles/about-git-rebase\n.. _unidecode: https://pypi.python.org/pypi/Unidecode\n.. _`Luca Sbardella`: http://lucasbardella.com\n.. _`Quantmind`: http://quantmind.com\n.. _JSON-RPC: http://www.jsonrpc.org/\n.. _mcve: http://stackoverflow.com/help/mcve\n.. _python-certifi: https://certifi.io\n.. _greenlet: http://greenlet.readthedocs.io/\n.. _`pulsar.apps.greenio`: https://github.com/quantmind/pulsar/tree/master/pulsar/apps/greenio\n.. _`pulsar.apps.pulse`: https://github.com/quantmind/pulsar/tree/master/pulsar/apps/pulse\n.. _HttpClient: http://quantmind.github.io/pulsar/apps/http.html\n.. _`Data stores`: http://quantmind.github.io/pulsar/apps/data/index.html\n.. _`Task queue consumers`: https://github.com/quantmind/pulsar-queue\n.. _`Asynchronous botocore`: https://github.com/quantmind/pulsar-cloud\n.. _`django integration`: https://github.com/quantmind/pulsar-django\n.. _`python-pulsar`: http://stackoverflow.com/questions/tagged/python-pulsar\n.. _`Web Sockets`: http://quantmind.github.io/pulsar/apps/websockets.html\n.. _uvloop: https://github.com/MagicStack/uvloop\n.. _httptools: https://github.com/MagicStack/httptools\n.. _multidict: https://github.com/aio-libs/multidict\n.. _`Asynchronous WSGI server`: http://quantmind.github.io/pulsar/apps/wsgi/index.html\n.. _`Asynchronous Test suite`: http://quantmind.github.io/pulsar/apps/test.html\n.. _`Riot.im room`: https://riot.im/app/#/room/#pulsar:matrix.org\n","funding_links":[],"categories":["Networking","资源列表","Table of Contents","Python","Concurrency and Networking","http","Awesome Python"],"sub_categories":["网络","Toolkit","Networking"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantmind%2Fpulsar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantmind%2Fpulsar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantmind%2Fpulsar/lists"}