livery_grpc_server_sup (livery_grpc v0.1.1)

View Source

Dynamic supervisor for gRPC listeners.

livery_grpc:start_server/1 adds a livery_grpc_listener child here, so each running server is supervised and outlives the process that started it. stop_server/1 terminates the child.

Summary

Functions

Start a supervised listener; returns its owner pid.

Stop a supervised listener by its owner pid.

Functions

init/1

-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

start_server(StartOpts)

-spec start_server(livery_grpc_listener:start_opts()) -> {ok, pid()} | {error, term()}.

Start a supervised listener; returns its owner pid.

stop_server(Pid)

-spec stop_server(pid()) -> ok | {error, term()}.

Stop a supervised listener by its owner pid.