-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSE Error with gin adapter: "warning: unable to set write deadline" #491
Comments
@darrenparkinson it seems that the Gin context's https://github.com/gin-gonic/examples/blob/master/server-sent-event/main.go#L65 You may just not be able to use this functionality in Huma with Gin as the router. The alternative would be to try and figure out how to build it into the Gin adapter, but I'm not sure how feasible that is. |
@danielgtaylor I had the same problem and just switched to a different sse implementation. It uses Problem: Is there a way to get an entry in the openAPi doc say for cheers |
I am a little confused why this works: noOp := func(context.Context, *struct{}) (*struct{}, error) {
return nil, nil
}
huma.Get(api, "/shelf/stream", noOp, tag("stream"))
r.Handle("/shelf/stream", s) where s is the alternative implementation. I thought if a handler is registered for a route it there cannot be another one. But it works and i leave it for documentation, so one can get some OpenApi entries for |
getting the same logging with |
@jzillmann I have to confirm that, was also using chi. |
Hi,
Just looking to add SSE to an existing project that uses the gin router.
I'm using the example here but when I swap the router for Gin, I'm getting the error:
warning: unable to set write deadline
for every sent message.e.g.
I notice this doesn't happen when using humago or humachi.
I can see that the error comes from this line here I think, but not sure what I'd need to do to fix that?
Is it because the gin context referenced in the adapter doesn't implement the
SetWriteDeadline(time.Time) error
function?Any thoughts greatly appreciated.
Many thanks.
The text was updated successfully, but these errors were encountered: