HTTP
已收录文章:1篇
-
Golang · Go问答 | 2天前 | goroutine · HTTP · Context · 超时控制 · Go问答 · WithTimeout Go问答 context取消 QueryContext HTTP请求取消 goroutine退出Go HTTP 请求断开后,r.Context() 会收到取消信号,但服务端慢任务不会凭空停止。只有把 context 继续传给数据库、下游 HTTP 调用、消息消费和 goroutine,取消与超时才会真正变成资源释放动作。120 收藏