Skip to content

bensnyde/aiosfstream-ng

 
 

Repository files navigation

aiosfstream-ng ===========

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

Usage

import asyncio

from aiosfstream-ng import SalesforceStreamingClient


async def stream_events():
    # connect to Streaming API
    async with SalesforceStreamingClient(
            consumer_key="<consumer key>",
            consumer_secret="<consumer secret>",
            username="<username>",
            password="<password>") as client:

        # subscribe to topics
        await client.subscribe("/topic/one")
        await client.subscribe("/topic/two")

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

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

Install

pip install aiosfstream-ng

Requirements

About

Salesforce Streaming API client for asyncio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%