all AI news
Writing a chat application in Django 4.2 using async StreamingHttpResponse, Server-Sent Events and PostgreSQL LISTEN/NOTIFY
May 19, 2023, 3:42 p.m. |
Simon Willison's Weblog simonwillison.net
Excellent tutorial by Víðir Valberg Guðmundsson on implementing chat with server-sent events using the newly async-capable StreamingHttpResponse from Django 4.2x.
He uses PostgreSQL'a LISTEN/NOTIFY mechanism which can be used asynchronously in psycopg3 - at the cost of a separate connection per user of the chat.
The article also covers how to use the Last-Event-ID header to implement reconnections in server-sent events, transmitting any events that …
application asgi async chat django events postgresql server tutorial writing
More from simonwillison.net / Simon Willison's Weblog
uv pip install --exclude-newer example
1 day, 11 hours ago |
simonwillison.net
Quoting Nathaniel Borenstein
3 days, 7 hours ago |
simonwillison.net
Slop is the new name for unwanted AI-generated content
3 days, 9 hours ago |
simonwillison.net
OpenAI Model Spec, May 2024 edition
3 days, 10 hours ago |
simonwillison.net
Jobs in AI, ML, Big Data
Data Engineer
@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania
Artificial Intelligence – Bioinformatic Expert
@ University of Texas Medical Branch | Galveston, TX
Lead Developer (AI)
@ Cere Network | San Francisco, US
Research Engineer
@ Allora Labs | Remote
Ecosystem Manager
@ Allora Labs | Remote
Founding AI Engineer, Agents
@ Occam AI | New York