{"id":20895129,"url":"https://github.com/topheman/actix-web-sse-broadcast-from-thread","last_synced_at":"2026-06-03T19:31:40.886Z","repository":{"id":231193142,"uuid":"760886040","full_name":"topheman/actix-web-sse-broadcast-from-thread","owner":"topheman","description":"actix-web - server-sent-events handled with threads 🦀","archived":false,"fork":false,"pushed_at":"2024-02-20T21:02:17.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-12T22:43:33.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topheman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-20T21:01:47.000Z","updated_at":"2024-02-20T21:02:21.000Z","dependencies_parsed_at":"2024-04-03T00:20:35.440Z","dependency_job_id":null,"html_url":"https://github.com/topheman/actix-web-sse-broadcast-from-thread","commit_stats":null,"previous_names":["topheman/actix-web-sse-broadcast-from-thread"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/topheman/actix-web-sse-broadcast-from-thread","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Factix-web-sse-broadcast-from-thread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Factix-web-sse-broadcast-from-thread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Factix-web-sse-broadcast-from-thread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Factix-web-sse-broadcast-from-thread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topheman","download_url":"https://codeload.github.com/topheman/actix-web-sse-broadcast-from-thread/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topheman%2Factix-web-sse-broadcast-from-thread/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33876893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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-18T10:25:07.129Z","updated_at":"2026-06-03T19:31:40.870Z","avatar_url":"https://github.com/topheman.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# actix-web-sse-broadcast-from-thread\n\nThis project is based on the [server-sent-events example of actix-web](https://github.com/actix/examples/tree/master/server-sent-events).\n\nInstead of posting a message to an endpoint to be broadcasted, this project supports a thread from `actix_web::rt::spawn` which broadcasts messages every 200ms, messages which end up sent as server-sent-events.\n\nUse cases could be:\n\n- show the stock-exchange price in real-time\n- multiplayer game: sending updates in real time\n- ...\n\n### Features\n\nIt is interruptible via Ctrl+C (it is necessary to handle `Arc\u003cAtomicBool\u003e` in threads).\n\n## Run\n\n```sh\ncargo run\n\n# go to http://localhost:8080/\n```\n\n## Resources:\n\n- server sent events\n  - https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events\n  - https://www.reddit.com/r/actix/comments/wejj5e/sse_actix_web/\n  - https://github.com/chaudharypraveen98/actix-sse-example\n  - https://github.com/arve0/actix-sse\n- working\n  - [Share state between actix-web server and async closure](https://stackoverflow.com/questions/74167734/share-state-between-actix-web-server-and-async-closure)\n  - [spawn'ed HttpServer is not interruptible](https://github.com/actix/actix-web/issues/2739)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopheman%2Factix-web-sse-broadcast-from-thread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopheman%2Factix-web-sse-broadcast-from-thread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopheman%2Factix-web-sse-broadcast-from-thread/lists"}