You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
req := &ram.ListPoliciesRequest{
Marker: marker,
MaxItems: &maxItems,
PolicyType: &policyType,
}
// TODO: find a way to add parent context to the request
resp, err := ramClient.ListPoliciesWithOptions(req, &utils.RuntimeOptions{})
if err != nil {
return nil, err
}
So my objective is, when the parent context is meet the deadline, it will also cancelled the request. So it will not blocking.
What I'm expecting is looks like this:
req := &ram.ListPoliciesRequest{
Marker: marker,
MaxItems: &maxItems,
PolicyType: &policyType,
}
// TODO: find a way to add parent context to the request
resp, err := ramClient.ListPoliciesWithOptions(HERE-> ctx, req, &utils.RuntimeOptions{})
if err != nil {
return nil, err
}
Or I'm expecting to be able to add the context to the RuntimeOptions. But I have no clue for it.
Any workaround for this?
Fyi:
The ramClient on this example is from "github.com/alibabacloud-go/ram-20150501/v2/client"
The text was updated successfully, but these errors were encountered:
bearaujus
changed the title
[GoSDK] Is there any way to add parrent context to the request?
[GoSDK] Is there any way to add parent context to the request?
Nov 16, 2024
So if I have:
How to add that context to this function?
So my objective is, when the parent context is meet the deadline, it will also cancelled the request. So it will not blocking.
What I'm expecting is looks like this:
Or I'm expecting to be able to add the context to the RuntimeOptions. But I have no clue for it.
Any workaround for this?
Fyi:
The ramClient on this example is from "github.com/alibabacloud-go/ram-20150501/v2/client"
The text was updated successfully, but these errors were encountered: