This commit is contained in:
Feng Lee 2015-08-18 18:59:14 +08:00
parent 23336d98a4
commit 6d4351e8a9
1 changed files with 15 additions and 6 deletions

View File

@ -235,14 +235,23 @@ init([Id, _Opts]) ->
gproc_pool:connect_worker(pubsub, {?MODULE, Id}), gproc_pool:connect_worker(pubsub, {?MODULE, Id}),
{ok, #state{id = Id, submap = maps:new()}}. {ok, #state{id = Id, submap = maps:new()}}.
prioritise_call(_Msg, _From, _Len, _State) -> prioritise_call(Msg, _From, _Len, _State) ->
1. case Msg of
{subscriber, _, _} -> 1;
_ -> 0
end.
prioritise_cast(_Msg, _Len, _State) -> prioritise_cast(Msg, _Len, _State) ->
0. case Msg of
{unsubscribe, _, _} -> 2;
_ -> 0
end.
prioritise_info(_Msg, _Len, _State) -> prioritise_info(Msg, _Len, _State) ->
1. case Msg of
{'DOWN', _, _, _, _} -> 3;
_ -> 0
end.
handle_call({subscribe, SubPid, Topics}, _From, State) -> handle_call({subscribe, SubPid, Topics}, _From, State) ->
TopicSubs = lists:map(fun({<<"$Q/", _/binary>> = Queue, Qos}) -> TopicSubs = lists:map(fun({<<"$Q/", _/binary>> = Queue, Qos}) ->