From 0889aa470d0f52abb1ae66b13fd82a4030f94739 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Fri, 17 Jan 2025 10:57:18 +0100 Subject: [PATCH] chore: use correct types in typespecs --- src/client/grpc_client.erl | 9 +++++---- src/client/grpc_client_sup.erl | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client/grpc_client.erl b/src/client/grpc_client.erl index 22dc440..8ebd850 100644 --- a/src/client/grpc_client.erl +++ b/src/client/grpc_client.erl @@ -42,7 +42,8 @@ , code_change/3 ]). --export_type([ options/0 +-export_type([ client_options/0 + , options/0 , grpcstream/0]). -record(state, { @@ -64,7 +65,7 @@ %% Streams streams :: #{gun:stream_ref() => stream()}, %% Client options - client_opts :: client_opts(), + client_opts :: client_options(), %% Flush timer reference flush_timer_ref :: undefined | reference() }). @@ -110,7 +111,7 @@ -type server() :: {http | https, string(), inet:port_number()}. --type client_opts() :: +-type client_options() :: #{ encoding => grpc_frame:encoding() , gun_opts => gun:opts() , stream_batch_size => non_neg_integer() @@ -155,7 +156,7 @@ %% APIs %%-------------------------------------------------------------------- --spec start_link(term(), pos_integer(), server(), client_opts()) +-spec start_link(term(), pos_integer(), server(), client_options()) -> {ok, pid()} | ignore | {error, term()}. start_link(Pool, Id, Server, Opts) when is_map(Opts) -> gen_server:start_link(?MODULE, [Pool, Id, Server, Opts], []). diff --git a/src/client/grpc_client_sup.erl b/src/client/grpc_client_sup.erl index d89ed26..bf26bbe 100644 --- a/src/client/grpc_client_sup.erl +++ b/src/client/grpc_client_sup.erl @@ -32,7 +32,7 @@ -type name() :: term(). --type options() :: grpc_client:options() +-type options() :: grpc_client:client_options() | #{pool_size => non_neg_integer()}. %%--------------------------------------------------------------------