Skip to content
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

希望支持DoRequestWithContext #114

Open
bilinxing opened this issue Jun 27, 2024 · 2 comments
Open

希望支持DoRequestWithContext #114

bilinxing opened this issue Jun 27, 2024 · 2 comments

Comments

@bilinxing
Copy link

tea/tea/tea.go

Line 307 in 8e3b425

func DoRequest(request *Request, requestRuntime map[string]interface{}) (response *Response, err error) {

现在golang的后端程序,都依赖context.Context管控协程生命周期,无论是redis、mysql、mongodb这些基础的driver还是其他三方的几乎所有的SDK都支持传递context.Context,不理解阿里云的SDK全部都没有传递context.Context。 实现上也很简单,http标准库有现成的方法。
func NewRequestWithContext(ctx context.Context, method, url string, body io.Reader) (*Request, error)

@KafuuEriri
Copy link

应该是go的sdk包是生成的,没有做适配编写

@JacksonTian
Copy link
Collaborator

主要的难点是对低版本兼容的要求,引入高版本的特性后会产生 break change。会在后续的大版本中支持 Context 的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@JacksonTian @bilinxing @KafuuEriri and others