فهرست منبع

chore: add some typing

William Yang 3 سال پیش
والد
کامیت
2d09a054e3
4فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 1 1
      apps/emqx/rebar.config.script
  2. 5 1
      apps/emqx/src/emqx_quic_connection.erl
  3. 1 1
      rebar.config
  4. 2 1
      rebar.config.erl

+ 1 - 1
apps/emqx/rebar.config.script

@@ -24,7 +24,7 @@ IsQuicSupp = fun() ->
 end,
 
 Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
-Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.16"}}}.
+Quicer = {quicer, {git, "https://github.com/qzhuyan/quic.git", {branch, "dev/william/multi-streams"}}}. %% @TODO revert
 
 ExtraDeps = fun(C) ->
     {deps, Deps0} = lists:keyfind(deps, 1, C),

+ 5 - 1
apps/emqx/src/emqx_quic_connection.erl

@@ -40,9 +40,11 @@
     new_stream/3
 ]).
 
--type cb_state() :: map() | proplists:proplist().
+-type cb_state() :: map().
 -type cb_ret() :: ok.
 
+-spec init(map() | list()) -> cb_state().
+
 init(ConnOpts) when is_list(ConnOpts) ->
     init(maps:from_list(ConnOpts));
 init(#{stream_opts := SOpts} = S) when is_list(SOpts) ->
@@ -50,6 +52,8 @@ init(#{stream_opts := SOpts} = S) when is_list(SOpts) ->
 init(ConnOpts) when is_map(ConnOpts) ->
     {ok, ConnOpts}.
 
+-spec closed(quicer:conneciton_hanlder(), quicer:conn_closed_props(), cb_state()) ->
+    {ok, cb_state()} | {error, any()}.
 closed(_Conn, #{is_peer_acked := true}, S) ->
     {stop, normal, S};
 closed(_Conn, #{is_peer_acked := false}, S) ->

+ 1 - 1
rebar.config

@@ -62,7 +62,7 @@
     , {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.3"}}}
     , {replayq, {git, "https://github.com/emqx/replayq.git", {tag, "0.3.7"}}}
     , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}}
-    , {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.7.0"}}}
+    , {emqtt, {git, "https://github.com/qzhuyan/emqtt", {branch, "dev/william/multi-streams"}}} %% @TODO revert
     , {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.4"}}}
     , {observer_cli, "1.7.1"} % NOTE: depends on recon 2.5.x
     , {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}}

+ 2 - 1
rebar.config.erl

@@ -39,7 +39,8 @@ bcrypt() ->
     {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}}.
 
 quicer() ->
-    {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.16"}}}.
+    %% @TODO revert
+    {quicer, {git, "https://github.com/qzhuyan/quic.git", {branch, "dev/william/multi-streams"}}}.
 
 jq() ->
     {jq, {git, "https://github.com/emqx/jq", {tag, "v0.3.9"}}}.