We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
源代码位置:https://github.com/xinliangnote/go-gin-api/blob/master/internal/pkg/core/context.go:line 392 // RequestContext (包装 Trace + Logger) 获取请求的 context (当client关闭后,会自动canceled) func (c *context) RequestContext() StdContext { return StdContext{ //c.ctx.Request.Context(), stdctx.Background(), c.Trace(), c.Logger(), } }
为何不用c.ctx.Request.Context();个人理解一个请求应该保持一个ctx,这样在请求退出的时候,会保证所有协程都收到结束指令;为何要用一个全新的ctx呢?还望大佬给解惑🙏🙏
The text was updated successfully, but these errors were encountered:
No branches or pull requests
源代码位置:https://github.com/xinliangnote/go-gin-api/blob/master/internal/pkg/core/context.go:line 392
// RequestContext (包装 Trace + Logger) 获取请求的 context (当client关闭后,会自动canceled)
func (c *context) RequestContext() StdContext {
return StdContext{
//c.ctx.Request.Context(),
stdctx.Background(),
c.Trace(),
c.Logger(),
}
}
为何不用c.ctx.Request.Context();个人理解一个请求应该保持一个ctx,这样在请求退出的时候,会保证所有协程都收到结束指令;为何要用一个全新的ctx呢?还望大佬给解惑🙏🙏
The text was updated successfully, but these errors were encountered: