Skip to content

Commit

Permalink
Restore some changes to queue slave
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoguin committed Mar 21, 2023
1 parent 9d72450 commit 0b0bc0b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion deps/rabbit/src/rabbit_mirror_queue_slave.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
code_change/3, handle_pre_hibernate/1, format_message_queue/2]).

-export([joined/2, members_changed/3, handle_msg/3, handle_terminate/2,
prioritise_cast/3, prioritise_info/3]).
prioritise_call/4, prioritise_cast/3, prioritise_info/3]).

-behaviour(gen_server2).
-behaviour(gm).
Expand Down Expand Up @@ -66,19 +66,41 @@
set_maximum_since_use(QPid, Age) ->
gen_server2:cast(QPid, {set_maximum_since_use, Age}).

prioritise_call(Msg, _From, _Len, _State) ->
case Msg of
info -> 9;
{gm_deaths, _Dead} -> 5;
_ -> 0
end.

prioritise_cast(Msg, _Len, _State) ->
case Msg of
{set_ram_duration_target, _Duration} -> 8;
{set_maximum_since_use, _Age} -> 8;
{run_backing_queue, _Mod, _Fun} -> 6;
{gm, _Msg} -> 5;
_ -> 0
end.

prioritise_info(Msg, _Len, _State) ->
case Msg of
update_ram_duration -> 8;
sync_timeout -> 6;
_ -> 0
end.

%prioritise_cast(Msg, _Len, _State) ->
% case Msg of
% {run_backing_queue, _Mod, _Fun} -> 6;
% _ -> 0
% end.
%
%prioritise_info(Msg, _Len, _State) ->
% case Msg of
% sync_timeout -> 6;
% _ -> 0
% end.

info(QPid) -> gen_server2:call(QPid, info, infinity).

init(Q) when ?is_amqqueue(Q) ->
Expand Down

0 comments on commit 0b0bc0b

Please sign in to comment.