Skip to content

Commit

Permalink
PISTON-990: allow gen_listener implementers to hibernate (2600hz#6193)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfinke authored and jamesaimonetti committed Dec 12, 2019
1 parent 9ecd461 commit 9f697dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/kazoo_amqp/src/gen_listener.erl
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@ handle_callback_info(Message
try Module:handle_info(Message, ModuleState) of
{'noreply', ModuleState1} ->
{'noreply', State#state{module_state=ModuleState1}};
{'noreply', ModuleState1, 'hibernate'} ->
{'noreply', State#state{module_state=ModuleState1}, 'hibernate'};
{'noreply', ModuleState1, Timeout} ->
Ref = start_timer(Timeout),
{'noreply', State#state{module_state=ModuleState1
Expand Down Expand Up @@ -1157,6 +1159,11 @@ handle_module_call(Request, From, #state{module=Module
,module_timeout_ref='undefined'
}
};
{'reply', Reply, ModuleState1, 'hibernate'} ->
{'reply', Reply
,State#state{module_state=ModuleState1}
,'hibernate'
};
{'reply', Reply, ModuleState1, Timeout} ->
{'reply', Reply
,State#state{module_state=ModuleState1
Expand All @@ -1165,6 +1172,8 @@ handle_module_call(Request, From, #state{module=Module
};
{'noreply', ModuleState1} ->
{'noreply', State#state{module_state=ModuleState1}};
{'noreply', ModuleState1, 'hibernate'} ->
{'noreply', State#state{module_state=ModuleState1}, 'hibernate'};
{'noreply', ModuleState1, Timeout} ->
{'noreply'
,State#state{module_state=ModuleState1
Expand All @@ -1191,6 +1200,8 @@ handle_module_cast(Msg, #state{module=Module
try Module:handle_cast(Msg, ModuleState) of
{'noreply', ModuleState1} ->
{'noreply', State#state{module_state=ModuleState1}};
{'noreply', ModuleState1, 'hibernate'} ->
{'noreply', State#state{module_state=ModuleState1}, 'hibernate'};
{'noreply', ModuleState1, Timeout} ->
Ref = start_timer(Timeout),
{'noreply', State#state{module_state=ModuleState1
Expand Down

0 comments on commit 9f697dc

Please sign in to comment.