这是indexloc提供的服务,不要输入任何密码
Skip to content

SSE Error with gin adapter: "warning: unable to set write deadline" #491

@darrenparkinson

Description

@darrenparkinson

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.

router := gin.Default()
api := humagin.New(router, huma.DefaultConfig("My API", "1.0.0"))

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions