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 redis as a Redis client
  • Supports namespaces, rooms and regular Socket.IO message emitting
import redis
from socketio_emitter import Emitter

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

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

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

async with emitter.namespace("/nsp") as nsp:
    async 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.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

socket_io_redis_emitter-0.0.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file socket_io_redis_emitter-0.0.3.tar.gz.

File metadata

  • Download URL: socket_io_redis_emitter-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for socket_io_redis_emitter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a18d0f089d9aadcea5b7befca60624419940589e3e8478987e701e610028b1f0
MD5 d61a5fba590e2ab39b17348c9031a9cd
BLAKE2b-256 6fa00ae2bd74113ff4a740a4d3c3024b08661caa016d7657091d588cd00ff67a

See more details on using hashes here.

File details

Details for the file socket_io_redis_emitter-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for socket_io_redis_emitter-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 084f9d49d3867cd06ef4c8bfbc102d3c7f5093fb98f60e73a080d3722f6f4331
MD5 bdd27848a0ec65883712c3e0a340472e
BLAKE2b-256 3200229afcce321ef47dcc78c61a3264d0819ddc8e1f1762f5937b50ab66504d

See more details on using hashes here.

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