xiaotushaoxia
xiaotushaoxia
你的需求是。“当一个请求过来的时候你阻塞地调用一个函数(函数第一个参数是ctx),你希望客户端断开tcp连接的时候可以让ctx Done” 吗。 @peng19940915
> > xiaotushaoxia > > 抱歉这么晚才回复,hertz有办法能实现嘛?目前业务上有类似场景,用户发起了一个请求,服务端调用了一个第三方程序,但有时候用户主动断开请求后,第三方程序还是在跑 我也没找到,可能要换上websocket吧 这样可以知道连接有没有断开
i dont think this is a good pr. same problem in all others type alias. ```go type uintAlias uint16 ToString(uintAlias (1)) // "1" ```
break backwards. looks not good for me. if somebody write code like this, this pr make it build fail ```go func handleTest(c *gin.Context) { var cpKeys = make(map[string]any, len(c.Keys)) for...
Your change has caused the GetString function to return two values, breaking backward compatibility, which is unacceptable. Moreover, why are you only focusing on modifying GetString? Don't you also want...
codecov test failed, because [3dc1cd6)](https://app.codecov.io/gh/gin-gonic/gin/commit/3dc1cd6572b4e3a0cd170a15debe546c2c72294f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term=gin-gonic) is too early. some commits between this commit and [3dc1cd6)](https://app.codecov.io/gh/gin-gonic/gin/commit/3dc1cd6572b4e3a0cd170a15debe546c2c72294f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term=gin-gonic) make code coverage decrease
@appleboy hello, does this pr looks good? and is this pr can be merged in v1.11?
@appleboy Why no feedback? If PR is bad, close it, if good, merge it.
嗯。我的想法是参考net.http实现。net.http中的conn会记录状态 New Idle Active, server(hzrtz中的Transporter) shutdown的时候在ctx.Done前一次次关闭全部Idle的conn,直到全部连接关闭。 所以需要做的事 1. 因为conn的状态要更新,所以handler方法中要更新conn的状态 2. 因为要关闭关闭idle的conn,所以Transporter需要记录全部的conn 2的主要问题是要记录全部conn需要加锁,不知道会不会有性能影响(不过可能是杞人忧天,不要提前优化....) 1难受的点在conn的状态维护要离开Transporter,在http协议处理那边(pkg.protocol.server下的Server.Serve)。而Serve的参数network.Conn又没有设置状态的方法,修改network.Conn又感觉不妥。 @welkeyever
嗯。本来就是为了高性能做的这个,我翻了下issues,看到也有提到hertz因为性能舍弃一些边缘功能的评论。 然后是一开始我的评论提到netpoll.transport没这个问题。其实netpoll.transport的shutdown应该有差不多的问题,它shutdown后可能程序直接就退出了,不会等当前的连接完成。 权衡下看要不要处理这个问题吧 @li-jin-gou @welkeyever