feat(queue): fix dialyzer issues
This commit is contained in:
parent
e294d35703
commit
e408804efb
|
@ -821,10 +821,10 @@ list_client_subscriptions(ClientId) ->
|
||||||
{error, not_found}
|
{error, not_found}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_client_subscription(emqx_types:clientid(), topic_filter()) ->
|
-spec get_client_subscription(emqx_types:clientid(), topic_filter() | share_topic_filter()) ->
|
||||||
subscription() | undefined.
|
subscription() | undefined.
|
||||||
get_client_subscription(ClientId, #share{} = ShareTopicFilter) ->
|
get_client_subscription(ClientId, #share{} = ShareTopicFilter) ->
|
||||||
emqx_persistent_session_ds_subs:cold_get_subscription(ClientId, ShareTopicFilter);
|
emqx_persistent_session_ds_shared_subs:cold_get_subscription(ClientId, ShareTopicFilter);
|
||||||
get_client_subscription(ClientId, TopicFilter) ->
|
get_client_subscription(ClientId, TopicFilter) ->
|
||||||
emqx_persistent_session_ds_subs:cold_get_subscription(ClientId, TopicFilter).
|
emqx_persistent_session_ds_subs:cold_get_subscription(ClientId, TopicFilter).
|
||||||
|
|
||||||
|
|
|
@ -606,7 +606,7 @@ to_map(S, _SharedSubS) ->
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% cold_get_subscription
|
%% cold_get_subscription
|
||||||
|
|
||||||
-spec cold_get_subscription(emqx_persistent_session_ds:id(), emqx_types:topic()) ->
|
-spec cold_get_subscription(emqx_persistent_session_ds:id(), share_topic_filter()) ->
|
||||||
emqx_persistent_session_ds:subscription() | undefined.
|
emqx_persistent_session_ds:subscription() | undefined.
|
||||||
cold_get_subscription(SessionId, ShareTopicFilter) ->
|
cold_get_subscription(SessionId, ShareTopicFilter) ->
|
||||||
case emqx_persistent_session_ds_state:cold_get_subscription(SessionId, ShareTopicFilter) of
|
case emqx_persistent_session_ds_state:cold_get_subscription(SessionId, ShareTopicFilter) of
|
||||||
|
|
|
@ -399,7 +399,9 @@ new_id(Rec) ->
|
||||||
get_subscription(TopicFilter, Rec) ->
|
get_subscription(TopicFilter, Rec) ->
|
||||||
gen_get(?subscriptions, TopicFilter, Rec).
|
gen_get(?subscriptions, TopicFilter, Rec).
|
||||||
|
|
||||||
-spec cold_get_subscription(emqx_persistent_session_ds:id(), emqx_types:topic()) ->
|
-spec cold_get_subscription(
|
||||||
|
emqx_persistent_session_ds:id(), emqx_types:topic() | emqx_types:share()
|
||||||
|
) ->
|
||||||
[emqx_persistent_session_ds_subs:subscription()].
|
[emqx_persistent_session_ds_subs:subscription()].
|
||||||
cold_get_subscription(SessionId, Topic) ->
|
cold_get_subscription(SessionId, Topic) ->
|
||||||
kv_pmap_read(?subscription_tab, SessionId, Topic).
|
kv_pmap_read(?subscription_tab, SessionId, Topic).
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
||||||
|
|
||||||
-include("emqx_ds_shared_sub_proto.hrl").
|
-include("emqx_ds_shared_sub_proto.hrl").
|
||||||
|
-include("emqx_ds_shared_sub_config.hrl").
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
new/1,
|
new/1,
|
||||||
|
@ -109,9 +110,13 @@ open(TopicSubscriptions, Opts) ->
|
||||||
),
|
),
|
||||||
State1.
|
State1.
|
||||||
|
|
||||||
-spec can_subscribe(t(), share_topic_filter(), emqx_types:subopts()) -> ok.
|
-spec can_subscribe(t(), share_topic_filter(), emqx_types:subopts()) ->
|
||||||
|
ok | {error, emqx_types:reason_code()}.
|
||||||
can_subscribe(_State, _ShareTopicFilter, _SubOpts) ->
|
can_subscribe(_State, _ShareTopicFilter, _SubOpts) ->
|
||||||
ok.
|
case ?dq_config(enable) of
|
||||||
|
true -> ok;
|
||||||
|
false -> {error, ?RC_SHARED_SUBSCRIPTIONS_NOT_SUPPORTED}
|
||||||
|
end.
|
||||||
|
|
||||||
-spec on_subscribe(t(), share_topic_filter(), emqx_types:subopts()) -> t().
|
-spec on_subscribe(t(), share_topic_filter(), emqx_types:subopts()) -> t().
|
||||||
on_subscribe(State0, ShareTopicFilter, _SubOpts) ->
|
on_subscribe(State0, ShareTopicFilter, _SubOpts) ->
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
emqx_ds_shared_sub_schema {
|
emqx_ds_shared_sub_schema {
|
||||||
|
|
||||||
|
enable.desc:
|
||||||
|
"""Enable the shared subscription feature."""
|
||||||
|
|
||||||
|
enable.label:
|
||||||
|
"""Enable Shared Subscription"""
|
||||||
|
|
||||||
session_find_leader_timeout_ms.desc:
|
session_find_leader_timeout_ms.desc:
|
||||||
"""The timeout in milliseconds for the session to find a leader.
|
"""The timeout in milliseconds for the session to find a leader.
|
||||||
If the session cannot find a leader within this time, the session will retry."""
|
If the session cannot find a leader within this time, the session will retry."""
|
||||||
|
|
Loading…
Reference in New Issue