NewXXXClient doesnt run Start or return error

This commit is contained in:
Ethan Buchman
2017-05-15 11:29:34 -04:00
parent fadfcfdcb0
commit eda4f2dddc
9 changed files with 46 additions and 33 deletions

View File

@ -27,14 +27,13 @@ type grpcClient struct {
resCb func(*types.Request, *types.Response) // listens to all callbacks
}
func NewGRPCClient(addr string, mustConnect bool) (*grpcClient, error) {
func NewGRPCClient(addr string, mustConnect bool) *grpcClient {
cli := &grpcClient{
addr: addr,
mustConnect: mustConnect,
}
cli.BaseService = *cmn.NewBaseService(nil, "grpcClient", cli)
_, err := cli.Start() // Just start it, it's confusing for callers to remember to start.
return cli, err
return cli
}
func dialerFunc(addr string, timeout time.Duration) (net.Conn, error) {