Skip to main content

An asynchronous Redis-based Socket.IO emitter for Python

Project description

Socket.IO Redis Emitter

This is an asynchronous Redis-based Socket.IO emitter for Python.

Installation

pip install socket.io-redis-emitter
# or
poetry add socket.io-redis-emitter

Features

  • High quality, typed and modern Python codebase
  • Clean, concise and Pythonic API
  • Uses aioredis as a Redis client
  • Supports namespaces, rooms and regular Socket.IO message emitting
from aioredis import Redis
from socketio_emitter import Emitter

client = Redis(...)
emitter = Emitter(client=client)

with emitter.namespace("/nsp") as nsp:
    with nsp.rooms("room1", "room2") as clients:
        await clients.emit("machineStatus", {"status": "ok"})
  • Remote requests to join, leave rooms or to disconnect
from aioredis import Redis
from socketio_emitter import Emitter

client = Redis(...)
emitter = Emitter(client=client)

with emitter.namespace("/nsp") as nsp:
    with nsp.rooms("room1", "room2") as clients:
        await clients.join("room3")
        # await clients.leave("room3")
        # await clients.disconnect()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socket.io-redis-emitter-0.0.2.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

socket.io_redis_emitter-0.0.2.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page