Skip to content

Commit

Permalink
chore: expose NewClient method to end users
Browse files Browse the repository at this point in the history
This will allow users to create a connection, leaving it in idle state, rather than having it automatically try and connect in the background, which is the current behavior of `Dial`. Leaving the connection in idle state is more consistent with how other grpc implementations deal with connections
  • Loading branch information
bruuuuuuuce authored Feb 28, 2024
1 parent 99ded5c commit 3575d42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires
}, nil
}

// newClient returns a new client in idle mode.
func newClient(target string, opts ...DialOption) (conn *ClientConn, err error) {
// NewClient returns a new client in idle mode.
func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) {
cc := &ClientConn{
target: target,
conns: make(map[*addrConn]struct{}),
Expand Down

0 comments on commit 3575d42

Please # to comment.