© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•11mo ago•
2 replies
khy

Streaming response disconnect hook

Workers
I'm experimenting with a worker that responds with an indefinite
ReadableStream
ReadableStream
- for the sake of this example, let's just say that it sends the current time as a string every second. I'd like to know when the client manually disconnects, and when that happens, write the number of messages I've sent until that point to a data store. Is there any way to achieve this reliably with Workers? I'm primarily interested in Rust, but would also be interested in a TS/JS solution.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Worker response not streaming
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
15mo ago
Does the local runtime support streaming response?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
Streaming response breaks on one Cloudflare account, but not the other
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
7mo ago