Skip to content

Instantly share code, notes, and snippets.

View chenkovsky's full-sized avatar

Chen Chongchen chenkovsky

  • Fudan
  • Shanghai
View GitHub Profile
@chenkovsky
chenkovsky / fastapi_websocket_redis_pubsub.py
Created April 29, 2024 08:00 — forked from timhughes/fastapi_websocket_redis_pubsub.py
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies