{"id":20178104,"url":"https://github.com/vsnthdev/flask-queue-sse","last_synced_at":"2025-10-13T21:02:43.788Z","repository":{"id":122553602,"uuid":"568862333","full_name":"vsnthdev/flask-queue-sse","owner":"vsnthdev","description":"A simple implementation of Server-Sent Events for Flask that doesn't require Redis pub/sub.","archived":false,"fork":false,"pushed_at":"2023-02-12T17:34:01.000Z","size":489,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T21:41:34.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsnthdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T15:11:55.000Z","updated_at":"2024-05-30T18:31:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"58566c21-3b09-4699-8fb7-745abe85bcfd","html_url":"https://github.com/vsnthdev/flask-queue-sse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vsnthdev/flask-queue-sse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsnthdev%2Fflask-queue-sse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsnthdev%2Fflask-queue-sse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsnthdev%2Fflask-queue-sse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsnthdev%2Fflask-queue-sse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsnthdev","download_url":"https://codeload.github.com/vsnthdev/flask-queue-sse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsnthdev%2Fflask-queue-sse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016885,"owners_count":26085912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T02:19:24.891Z","updated_at":"2025-10-13T21:02:43.784Z","avatar_url":"https://github.com/vsnthdev.png","language":"Python","readme":"\u003ch5 align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/vsnthdev/flask-queue-sse/designs/header.png\" alt=\"flask-queue-sse\"\u003e\n\u003c/h5\u003e\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003e\n        A simple implementation of \u003ca href=\"https://web.dev/eventsource-basics\"\u003eServer-Sent Events\u003c/a\u003e for \u003ca\n            href=\"https://flask.palletsprojects.com\"\u003eFlask\u003c/a\u003e that\n        doesn't require Redis pub/sub.\n    \u003c/strong\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca target=\"_blank\" rel=\"noopener\" href=\"https://pypi.org/project/flask-queue-sse\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/flask-queue-sse?style=flat-square\" alt=\"\"\u003e\n    \u003c/a\u003e\n    \u003ca target=\"_blank\" rel=\"noopener\" href=\"https://pypi.org/project/flask-queue-sse/#history\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/dm/flask-queue-sse\" alt=\"\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/vsnthdev/flask-queue-sse/issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues/vsnthdev/flask-queue-sse.svg?style=flat-square\" alt=\"\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/vsnthdev/flask-queue-sse/commits/main\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/last-commit/vsnthdev/flask-queue-sse.svg?style=flat-square\" alt=\"\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003c!-- header --\u003e\n\n**flask-queue-sse** is my first ever Python library. It implements the Server-Sent Events protocol using the built-in Python `Queue` class. Please read [why this package](#💡-why-this-package) before using it in production.\n\n\u003e Tweet to me \u003ca target=\"_blank\" rel=\"noopener\" href=\"https://vas.cx/twitter\"\u003e@vsnthdev\u003c/a\u003e, I'd love to know your\nexperience of this project 😀\n\n## 💡 Why this package\n\nMost implementations of Server-Sent Events available in PyPi for Flask require having a Redis database. This is to support horizontal scaling.\n\nThis library targets projects that don't want to deploy Redis seperately to get SSE working, and aren't aiming to horizontally scale _(have multiple instances of your app running behind a load balancer)_.\n\n## 💿 Installation\n\n```\npip install flask-queue-sse\n```\n\nPython 3.10 and above is required.\n\n## 🚀 Quick start\n\nAfter installing `flask-queue-sse`, you can start using it in the following way:\n\n```python\nfrom flask import Flask\nfrom flask_queue_sse import ServerSentEvents\n\napp = Flask(__name__)\n\n# storing sse events channel in memory\nsse: ServerSentEvents = None\n\n@app.route(\"/subscribe\")\ndef subscribe():\n    # telling Python to refer to global sse variable\n    global sse\n\n    # create a new server sent events channel\n    sse = ServerSentEvents()\n\n    # create a new thread and do the actual work\n    # on it, pass sse instance to it for emitting events\n    \n    # when an \"error\" or \"end\" event is emitted\n    # the connection closes\n\n    # return it as a response\n    return sse.response()\n```\n\nLook into the [examples](https://github.com/vsnthdev/flask-queue-sse/tree/main/examples) or send me a message for any queries, questions or issues. I'm always happy to help 😊\n\n## 💻 Building the project\n\n- 📁 Clone the repository.\n- 🏝️ Enter into the clonned directory \u0026 run `python -m venv .` to create a virtual environment.\n- 🔨 Install dependencies by running `pip install -r ./requirements.txt`.\n- 👨‍💻 Run the examples or edit the codebase.\n\n## 🏷️ Referrences\n\nThis library has been inspired by, and developed after consuming following resources:\n\n1. [Server-sent events in Flask without extra dependencies](https://maxhalford.github.io/blog/flask-sse-no-deps)\n2. [Why do I need redis?](https://github.com/singingwolfboy/flask-sse/issues/7)\n\n\u003c!-- footer --\u003e\n\n## 📰 License\n\u003e The **flask-queue-sse** project is released under the [Zlib license](https://github.com/vsnthdev/flask-queue-sse/blob/main/LICENSE.md). \u003cbr\u003e Developed \u0026amp; maintained By Vasanth Srivatsa. Copyright 2023 © Vasanth Developer.\n\u003chr\u003e\n\n\u003e \u003ca href=\"https://vsnth.dev\" target=\"_blank\" rel=\"noopener\"\u003evsnth.dev\u003c/a\u003e \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e YouTube \u003ca href=\"https://vas.cx/videos\" target=\"_blank\" rel=\"noopener\"\u003e@VasanthDeveloper\u003c/a\u003e \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter \u003ca href=\"https://vas.cx/twitter\" target=\"_blank\" rel=\"noopener\"\u003e@vsnthdev\u003c/a\u003e \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e LinkedIn \u003ca href=\"https://vas.cx/linkedin\" target=\"_blank\" rel=\"noopener\"\u003eVasanth Srivatsa\u003c/a\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsnthdev%2Fflask-queue-sse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsnthdev%2Fflask-queue-sse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsnthdev%2Fflask-queue-sse/lists"}