Skip to content

Commit

Permalink
Merge pull request #32 from emqx/fix/EMQX-13528/typespec
Browse files Browse the repository at this point in the history
chore: use correct types in typespecs
  • Loading branch information
keynslug authored Jan 17, 2025
2 parents 0268d9e + 0889aa4 commit 38a8742
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/client/grpc_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
, code_change/3
]).

-export_type([ options/0
-export_type([ client_options/0
, options/0
, grpcstream/0]).

-record(state, {
Expand All @@ -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()
}).
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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], []).
Expand Down
2 changes: 1 addition & 1 deletion src/client/grpc_client_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

-type name() :: term().

-type options() :: grpc_client:options()
-type options() :: grpc_client:client_options()
| #{pool_size => non_neg_integer()}.

%%--------------------------------------------------------------------
Expand Down

0 comments on commit 38a8742

Please sign in to comment.