Skip to content

fix: improve SSE stream response handling and add fasthttp support (#888)#1014

Closed
zhouyusd wants to merge 3 commits into
danielgtaylor:mainfrom
zhouyusd:fix-fasthttp-sse
Closed

fix: improve SSE stream response handling and add fasthttp support (#888)#1014
zhouyusd wants to merge 3 commits into
danielgtaylor:mainfrom
zhouyusd:fix-fasthttp-sse

Conversation

@zhouyusd

@zhouyusd zhouyusd commented Apr 14, 2026

Copy link
Copy Markdown

Fix #888

Copilot AI review requested due to automatic review settings April 14, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Server-Sent Events (SSE) streaming response handling by refactoring message sending and adding a fasthttp/Fiber-specific streaming implementation.

Changes:

  • Refactors SSE message writing into a reusable internal send(...) helper that accepts writer/encoder/flusher/deadliner dependencies.
  • Adds a fasthttp (*fasthttp.RequestCtx) streaming path using SetBodyStreamWriter to support Fiber/fasthttp response streaming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sse/sse.go
Comment thread sse/sse.go
@wolveix

wolveix commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Hey @zhouyusd! Thanks for taking the time to implement this. Unfortunately, we're strictly against importing excessive dependencies in the core Huma library unless they're absolutely necessary; with your implementation, all Huma users would have to import fasthttp. With this in mind, I created #1059 which introduces a small internal streaming hook. I referenced you directly in that PR.

Thanks again!

@wolveix wolveix closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSE: deadline failed to flush

3 participants