feat(zrpc): change NonBlock default to true following gRPC best practices (#5259)

This commit is contained in:
Kevin Wan
2025-10-26 20:56:34 +08:00
committed by GitHub
parent 98423ca948
commit d6c876860b
4 changed files with 22 additions and 1 deletions

View File

@@ -141,6 +141,15 @@ func (c *client) dial(server string, opts ...ClientOption) error {
return nil
}
// WithBlock sets the dialing to be blocking.
// Deprecated: blocking dials are not recommended by gRPC.
// See https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md
func WithBlock() ClientOption {
return func(options *ClientOptions) {
options.NonBlock = false
}
}
// WithDialOption returns a func to customize a ClientOptions with given dial option.
func WithDialOption(opt grpc.DialOption) ClientOption {
return func(options *ClientOptions) {