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
Built Distribution
File details
Details for the file socket.io-redis-emitter-0.0.2.tar.gz
.
File metadata
- Download URL: socket.io-redis-emitter-0.0.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.2 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 850c8fac8535cbfb8c6d03786b382dfbe8ea6deb3ccece5310a1abe15546fcae |
|
MD5 | e0c2b739efdddd5cdd9210c98c2f65a7 |
|
BLAKE2b-256 | 52920e99650292077ba0baa584f18128d5544de1cd8026bc7b41c6b232f8cfc2 |
File details
Details for the file socket.io_redis_emitter-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: socket.io_redis_emitter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.2 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c27495a97baf5b1d30cf22b3e9a57be862706569f6783fc58245b7bfdc394f65 |
|
MD5 | 3f2ad7dd8e0ce99ff8f69ffd8263bfcb |
|
BLAKE2b-256 | d71018214c9d13040ccd87d0cdc3268e9901914611e46f3a96f5e85c7149b909 |