Skip to content

Instantly share code, notes, and snippets.

View grohom's full-sized avatar
😀

Vlad Enache grohom

😀
  • Bucharest, Romania
View GitHub Profile
@ingoogni
ingoogni / cherrypy_SSE.py
Last active June 6, 2024 17:17
CherryPy SSE / Server-Sent Events, Eventsource helpers to publish data from cherrypy's pub/sub bus
import threading
import cherrypy
from cherrypy.process import plugins
class Portier(threading.Thread):
"""
The Doorman (Portier) detects changes of message by listening to the
subscribed channel, opens 'the door' as a message appears, yield it
and closes the door once trough.