grpc v0.3.0-alpha GRPC.Server.Supervisor
A simple supervisor to start your servers.
You can add it to your OTP tree as below. But to make the servers start, you have to config grpc
defmodule Your.App do
use Application
def start(_type, _args) do
import Supervisor.Spec
children = [
supervisor(GRPC.Server.Supervisor, [{Your.Server, 50051}])
]
opts = [strategy: :one_for_one, name: __MODULE__]
Supervisor.start_link(children, opts)
end
end
# config.exs
config :grpc, start_server: true
or
run `mix grpc.server` on local
View child_spec/3
for arguments.
Summary
Functions
Returns a specification to start this module under a supervisor
Return a child_spec to start server
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
child_spec(servers, port, opts \\ [])
child_spec(atom | [atom], integer, Keyword.t) :: Supervisor.Spec.spec
Return a child_spec to start server.
Options
:cred
- a credential created by functions ofGRPC.Credential
, an insecure server will be created without this option