Skip to content

Commit aae9e64

Browse files
authored
docs: fix and improve anti-patterns.md (grpc#7418)
1 parent ac5a7fe commit aae9e64

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Documentation/anti-patterns.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ to create _a_ connection which may need to be recreated if it is lost.
3030

3131
`grpc.Dial` uses "passthrough" as the default name resolver for backward
3232
compatibility while `grpc.NewClient` uses "dns" as its default name resolver.
33-
This subtle diffrence is important to legacy systems that also specified a
33+
This subtle difference is important to legacy systems that also specified a
3434
custom dialer and expected it to receive the target string directly.
3535

3636
For these reasons, using `grpc.Dial` is discouraged. Even though it is marked
@@ -62,10 +62,10 @@ the RPC was sent to a server.
6262

6363
Some users of `Dial` use it as a way to validate the configuration of their
6464
system. If you wish to maintain this behavior but migrate to `NewClient`, you
65-
can call `State` and `WaitForStateChange` until the channel is connected.
66-
However, if this fails, it does not mean that your configuration was bad - it
67-
could also mean the service is not reachable by the client due to connectivity
68-
reasons.
65+
can call `GetState`, then `Connect` if the state is `Idle` and
66+
`WaitForStateChange` until the channel is connected. However, if this fails,
67+
it does not mean that your configuration was bad - it could also mean the
68+
service is not reachable by the client due to connectivity reasons.
6969

7070
## Best practices for error handling in gRPC
7171

0 commit comments

Comments
 (0)