-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(transport/grpc,contrib): add NewClient method to gRPC client(#3312) #3323
base: main
Are you sure you want to change the base?
Conversation
…kratos#3312) * feat: update grpc v1.63.x * feat: use NewClient method replace Dial in gRPC client * test: update grpc client test case * docs: update README.md
please review this pr,thanks~ |
} | ||
|
||
// Deprecated: use newClient instead. | ||
func dial(ctx context.Context, options clientOptions, grpcOpts []grpc.DialOption) (*grpc.ClientConn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this still kept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal methods will not affect external compatibility
dialCtx, cancel := context.WithTimeout(dialCtx, time.Second) | ||
defer cancel() | ||
conn, err := grpc.DialContext(dialCtx, opt.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) | ||
conn, err := grpc.NewClient(opt.Endpoint, grpc.WithTransportCredentials(insecure.NewCredentials())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to control dial timeout
Description (what this PR does / why we need it):
Which issue(s) this PR fixes (resolves / be part of):
resolves: #3312
Other special notes for the reviewers: