@@ -153,26 +153,6 @@ defmodule GRPC.Client.Connection do
153153 """
154154 @ spec connect ( String . t ( ) , keyword ( ) ) :: { :ok , Channel . t ( ) } | { :error , any ( ) }
155155 def connect ( target , opts \\ [ ] ) do
156- supervisor_pid = Process . whereis ( GRPC.Client.Supervisor )
157-
158- if is_nil ( supervisor_pid ) or ! Process . alive? ( supervisor_pid ) do
159- raise """
160- GRPC.Client.Supervisor is not running. Please ensure it is started as part of your
161- application's supervision tree:
162-
163- children = [
164- {GRPC.Client.Supervisor, []}
165- ]
166-
167- opts = [strategy: :one_for_one, name: MyApp.Supervisor]
168- Supervisor.start_link(children, opts)
169-
170- You can also start it manually in scripts or test environments:
171-
172- {:ok, _pid} = DynamicSupervisor.start_link(strategy: :one_for_one, name: GRPC.Client.Supervisor)
173- """
174- end
175-
176156 ref = make_ref ( )
177157
178158 case build_initial_state ( target , Keyword . merge ( opts , ref: ref ) ) do
@@ -184,7 +164,6 @@ defmodule GRPC.Client.Connection do
184164 { :ok , ch }
185165
186166 { :error , { :already_started , _pid } } ->
187- # race: someone else started it first, ask the running process for its current channel
188167 case pick_channel ( opts ) do
189168 { :ok , % Channel { } = channel } ->
190169 { :ok , channel }
0 commit comments