Skip to main content

asyncpusher is an asynchronous python client library for Pusher

Features

  • Uses well-maintained aiohttp's websocket library
  • Reliable connection
  • Auto handles reconnection
  • Asynchronous
  • Fast
  • Supports Pusher Channels protocol 7
  • Supports presence and private channels

Install

$ python3 -m pip install asyncpusher

Usage

import asyncio
import logging
import sys

from asyncpusher.channel import Channel
from asyncpusher.pusher import Pusher

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)


async def handle_event(data):
    logging.info(f"{market} {data}")


async def main():
    loop = asyncio.get_running_loop()

    pusher = Pusher("<PUSHER_APP_KEY>", loop=loop)
    pusher.channels[channel_name] = channel
    await pusher.connect()
    channel_name = "<CHANNEL_NAME>"
    channel = await pusher.subscribe(channel_name)
    channel.bind("diff", handle_event)
    await asyncio.sleep(5)
    await pusher.unsubscribe(channel_name)
    await asyncio.sleep(1)
    await pusher.disconnect()


asyncio.run(main())

Metadata

Release files for asyncpusher 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asyncpusher 0.2.5
File Size Uploaded
asyncpusher-0.2.5.tar.gz 50.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asyncpusher 0.2.5
File Interpreter ABI Platform
asyncpusher-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 57.7 kB

Release files / asyncpusher-0.2.5.tar.gz

Download URL asyncpusher-0.2.5.tar.gz
Size 50.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0aa178ac501a213b90d696f5052d0a86aad68a892b596b75f9e1de55172e6111
BLAKE2b-256 checksum
How to use checksums
44b438e16e40470f91211ba66ec4688d936b32a40499d0452d847650cb3cd8b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release files / asyncpusher-0.2.5-py3-none-any.whl

Download URL asyncpusher-0.2.5-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3527e73abafdbbded8403d1dadd14423ddcf92344f6f7cf3fd3c51878cca00fd
BLAKE2b-256 checksum
How to use checksums
8d9753e106c1cfe049b3771847c2a0d726cef1b9d1bf9c289754e7f3e1f9534e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page