Skip to content

bensnyde/aiocometd-ng

 
 

Repository files navigation

aiocometd-ng

aicometd-ng is a Python 3.10+ compatible fork of https://github.com/robertmrk/aiocometd

Usage

import asyncio

from aiocometd import Client

async def chat():

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

            # subscribe to channels
            await client.subscribe("/chat/demo")
            await client.subscribe("/members/demo")

            # listen for incoming messages
            async for message in client:
                topic = message["channel"]
                data = message["data"]
                print(f"{topic}: {data}")

if __name__ == "__main__":
    asyncio.run(chat())

Install

pip install aiocometd-ng

Requirements

About

CometD client for asyncio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%