aiocometd-ng


Nameaiocometd-ng JSON
Version 0.5.5 PyPI version JSON
download
home_pagehttps://github.com/bensnyde/aiocometd-ng
SummaryCometD client for asyncio
upload_time2024-02-20 13:20:47
maintainer
docs_urlNone
authorBenton Snyder
requires_python>=3.10.0
licenseMIT
keywords asyncio aiohttp comet cometd bayeux push streaming
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            aiocometd
=========

.. image:: https://badge.fury.io/py/aiocometd.svg
    :target: https://badge.fury.io/py/aiocometd
    :alt: PyPI package

.. image:: https://readthedocs.org/projects/aiocometd/badge/?version=latest
    :target: http://aiocometd.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status

.. image:: https://travis-ci.org/robertmrk/aiocometd.svg?branch=develop
    :target: https://travis-ci.org/robertmrk/aiocometd
    :alt: Build status

.. image:: https://coveralls.io/repos/github/robertmrk/aiocometd/badge.svg
    :target: https://coveralls.io/github/robertmrk/aiocometd
    :alt: Coverage

.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
    :target: https://opensource.org/licenses/MIT
    :alt: MIT license

aiocometd is a CometD_ client built using asyncio_, implementing the Bayeux_
protocol.

CometD_ is a scalable WebSocket and HTTP based event and message routing bus.
CometD_ makes use of WebSocket and HTTP push technologies known as Comet_ to
provide low-latency data from the server to browsers and client applications.

Features
--------

- Supported transports:
   - ``long-polling``
   - ``websocket``
- Automatic reconnection after network failures
- Extensions

Usage
-----

.. code-block:: python

    import asyncio

    from aiocometd import Client

    async def chat():
        nickname = "John"

        # connect to the server
        async with Client("http://example.com/cometd") as client:

                # subscribe to channels to receive chat messages and
                # notifications about new members
                await client.subscribe("/chat/demo")
                await client.subscribe("/members/demo")

                # send initial message
                await client.publish("/chat/demo", {
                    "user": nickname,
                    "membership": "join",
                    "chat": nickname + " has joined"
                })
                # add the user to the chat room's members
                await client.publish("/service/members", {
                    "user": nickname,
                    "room": "/chat/demo"
                })

                # listen for incoming messages
                async for message in client:
                    if message["channel"] == "/chat/demo":
                        data = message["data"]
                        print(f"{data['user']}: {data['chat']}")

    if __name__ == "__main__":
        loop = asyncio.get_event_loop()
        loop.run_until_complete(chat())

For more detailed usage examples take a look at the
`command line chat example <cli_example_>`_ or for a more complex example with
a GUI check out the aiocometd-chat-demo_.

Documentation
-------------

https://aiocometd.readthedocs.io/

.. _aiohttp: https://github.com/aio-libs/aiohttp/
.. _CometD: https://cometd.org/
.. _Comet: https://en.wikipedia.org/wiki/Comet_(programming)
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _Bayeux: https://docs.cometd.org/current/reference/#_bayeux
.. _ext: https://docs.cometd.org/current/reference/#_bayeux_ext
.. _cli_example: https://github.com/robertmrk/aiocometd/blob/develop/examples/chat.py
.. _aiocometd-chat-demo: https://github.com/robertmrk/aiocometd-chat-demo

Changelog
=========

0.4.5 (2019-03-14)
------------------

- Fix connection issues when used with reverse proxy servers with cookie based
  sticky sessions

0.4.4 (2019-02-26)
------------------

- Refactor the websocket transport implementation to use a single connection
  per client

0.4.3 (2019-02-12)
------------------

- Fix reconnection issue on Salesforce Streaming API

0.4.2 (2019-01-15)
------------------

- Fix the handling of invalid websocket transport responses
- Fix the handling of failed subscription responses

0.4.1 (2019-01-04)
------------------

- Add documentation links

0.4.0 (2019-01-04)
------------------

- Add type hints
- Add integration tests

0.3.1 (2018-06-15)
------------------

- Fix premature request timeout issue

0.3.0 (2018-05-04)
------------------

- Enable the usage of third party JSON libraries
- Fix detection and recovery from network failures

0.2.3 (2018-04-24)
------------------

- Fix RST rendering issues

0.2.2 (2018-04-24)
------------------

- Fix documentation typos
- Improve examples
- Reorganise documentation

0.2.1 (2018-04-21)
------------------

- Add PyPI badge to README

0.2.0 (2018-04-21)
------------------

- Supported transports:
   - ``long-polling``
   - ``websocket``
- Automatic reconnection after network failures
- Extensions

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bensnyde/aiocometd-ng",
    "name": "aiocometd-ng",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10.0",
    "maintainer_email": "",
    "keywords": "asyncio aiohttp comet cometd bayeux push streaming",
    "author": "Benton Snyder",
    "author_email": "benton@bensnyde.me",
    "download_url": "https://files.pythonhosted.org/packages/c1/3f/3e939678762a566754bf0fd05fbecb6827b7cbdd4e6ce1014ffff1ddeb7d/aiocometd-ng-0.5.5.tar.gz",
    "platform": null,
    "description": "aiocometd\r\n=========\r\n\r\n.. image:: https://badge.fury.io/py/aiocometd.svg\r\n    :target: https://badge.fury.io/py/aiocometd\r\n    :alt: PyPI package\r\n\r\n.. image:: https://readthedocs.org/projects/aiocometd/badge/?version=latest\r\n    :target: http://aiocometd.readthedocs.io/en/latest/?badge=latest\r\n    :alt: Documentation Status\r\n\r\n.. image:: https://travis-ci.org/robertmrk/aiocometd.svg?branch=develop\r\n    :target: https://travis-ci.org/robertmrk/aiocometd\r\n    :alt: Build status\r\n\r\n.. image:: https://coveralls.io/repos/github/robertmrk/aiocometd/badge.svg\r\n    :target: https://coveralls.io/github/robertmrk/aiocometd\r\n    :alt: Coverage\r\n\r\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\r\n    :target: https://opensource.org/licenses/MIT\r\n    :alt: MIT license\r\n\r\naiocometd is a CometD_ client built using asyncio_, implementing the Bayeux_\r\nprotocol.\r\n\r\nCometD_ is a scalable WebSocket and HTTP based event and message routing bus.\r\nCometD_ makes use of WebSocket and HTTP push technologies known as Comet_ to\r\nprovide low-latency data from the server to browsers and client applications.\r\n\r\nFeatures\r\n--------\r\n\r\n- Supported transports:\r\n   - ``long-polling``\r\n   - ``websocket``\r\n- Automatic reconnection after network failures\r\n- Extensions\r\n\r\nUsage\r\n-----\r\n\r\n.. code-block:: python\r\n\r\n    import asyncio\r\n\r\n    from aiocometd import Client\r\n\r\n    async def chat():\r\n        nickname = \"John\"\r\n\r\n        # connect to the server\r\n        async with Client(\"http://example.com/cometd\") as client:\r\n\r\n                # subscribe to channels to receive chat messages and\r\n                # notifications about new members\r\n                await client.subscribe(\"/chat/demo\")\r\n                await client.subscribe(\"/members/demo\")\r\n\r\n                # send initial message\r\n                await client.publish(\"/chat/demo\", {\r\n                    \"user\": nickname,\r\n                    \"membership\": \"join\",\r\n                    \"chat\": nickname + \" has joined\"\r\n                })\r\n                # add the user to the chat room's members\r\n                await client.publish(\"/service/members\", {\r\n                    \"user\": nickname,\r\n                    \"room\": \"/chat/demo\"\r\n                })\r\n\r\n                # listen for incoming messages\r\n                async for message in client:\r\n                    if message[\"channel\"] == \"/chat/demo\":\r\n                        data = message[\"data\"]\r\n                        print(f\"{data['user']}: {data['chat']}\")\r\n\r\n    if __name__ == \"__main__\":\r\n        loop = asyncio.get_event_loop()\r\n        loop.run_until_complete(chat())\r\n\r\nFor more detailed usage examples take a look at the\r\n`command line chat example <cli_example_>`_ or for a more complex example with\r\na GUI check out the aiocometd-chat-demo_.\r\n\r\nDocumentation\r\n-------------\r\n\r\nhttps://aiocometd.readthedocs.io/\r\n\r\n.. _aiohttp: https://github.com/aio-libs/aiohttp/\r\n.. _CometD: https://cometd.org/\r\n.. _Comet: https://en.wikipedia.org/wiki/Comet_(programming)\r\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\r\n.. _Bayeux: https://docs.cometd.org/current/reference/#_bayeux\r\n.. _ext: https://docs.cometd.org/current/reference/#_bayeux_ext\r\n.. _cli_example: https://github.com/robertmrk/aiocometd/blob/develop/examples/chat.py\r\n.. _aiocometd-chat-demo: https://github.com/robertmrk/aiocometd-chat-demo\r\n\r\nChangelog\r\n=========\r\n\r\n0.4.5 (2019-03-14)\r\n------------------\r\n\r\n- Fix connection issues when used with reverse proxy servers with cookie based\r\n  sticky sessions\r\n\r\n0.4.4 (2019-02-26)\r\n------------------\r\n\r\n- Refactor the websocket transport implementation to use a single connection\r\n  per client\r\n\r\n0.4.3 (2019-02-12)\r\n------------------\r\n\r\n- Fix reconnection issue on Salesforce Streaming API\r\n\r\n0.4.2 (2019-01-15)\r\n------------------\r\n\r\n- Fix the handling of invalid websocket transport responses\r\n- Fix the handling of failed subscription responses\r\n\r\n0.4.1 (2019-01-04)\r\n------------------\r\n\r\n- Add documentation links\r\n\r\n0.4.0 (2019-01-04)\r\n------------------\r\n\r\n- Add type hints\r\n- Add integration tests\r\n\r\n0.3.1 (2018-06-15)\r\n------------------\r\n\r\n- Fix premature request timeout issue\r\n\r\n0.3.0 (2018-05-04)\r\n------------------\r\n\r\n- Enable the usage of third party JSON libraries\r\n- Fix detection and recovery from network failures\r\n\r\n0.2.3 (2018-04-24)\r\n------------------\r\n\r\n- Fix RST rendering issues\r\n\r\n0.2.2 (2018-04-24)\r\n------------------\r\n\r\n- Fix documentation typos\r\n- Improve examples\r\n- Reorganise documentation\r\n\r\n0.2.1 (2018-04-21)\r\n------------------\r\n\r\n- Add PyPI badge to README\r\n\r\n0.2.0 (2018-04-21)\r\n------------------\r\n\r\n- Supported transports:\r\n   - ``long-polling``\r\n   - ``websocket``\r\n- Automatic reconnection after network failures\r\n- Extensions\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CometD client for asyncio",
    "version": "0.5.5",
    "project_urls": {
        "CI": "https://travis-ci.org/robertmrk/aiocometd",
        "Coverage": "https://coveralls.io/github/robertmrk/aiocometd",
        "Docs": "http://aiocometd.readthedocs.io/",
        "Homepage": "https://github.com/bensnyde/aiocometd-ng"
    },
    "split_keywords": [
        "asyncio",
        "aiohttp",
        "comet",
        "cometd",
        "bayeux",
        "push",
        "streaming"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0059ac5a8036bbc3c6a30701615160a953bbf0035c1e685595d72e9218468f0f",
                "md5": "25c5bc7e60663e6182ba002c2f7dcf56",
                "sha256": "0e09e8e9983a8a8d3f83ee8a048d6b74881f2a36c99b8575d3936a126d740bbd"
            },
            "downloads": -1,
            "filename": "aiocometd_ng-0.5.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "25c5bc7e60663e6182ba002c2f7dcf56",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.0",
            "size": 28132,
            "upload_time": "2024-02-20T13:20:46",
            "upload_time_iso_8601": "2024-02-20T13:20:46.365021Z",
            "url": "https://files.pythonhosted.org/packages/00/59/ac5a8036bbc3c6a30701615160a953bbf0035c1e685595d72e9218468f0f/aiocometd_ng-0.5.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c13f3e939678762a566754bf0fd05fbecb6827b7cbdd4e6ce1014ffff1ddeb7d",
                "md5": "fa69c95c0188519d4233c82ca4522e39",
                "sha256": "a5d4aa15d0a17830769cea1746a8637f429509e2a5f9773f5a01c7d9e899363f"
            },
            "downloads": -1,
            "filename": "aiocometd-ng-0.5.5.tar.gz",
            "has_sig": false,
            "md5_digest": "fa69c95c0188519d4233c82ca4522e39",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.0",
            "size": 56512,
            "upload_time": "2024-02-20T13:20:47",
            "upload_time_iso_8601": "2024-02-20T13:20:47.758988Z",
            "url": "https://files.pythonhosted.org/packages/c1/3f/3e939678762a566754bf0fd05fbecb6827b7cbdd4e6ce1014ffff1ddeb7d/aiocometd-ng-0.5.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 13:20:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bensnyde",
    "github_project": "aiocometd-ng",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "aiocometd-ng"
}
        
Elapsed time: 0.18894s