Add a `flush` handler to amqp_channel
rabbit_channel may use amqp_channel as the writer. When terminating, rabbit_channel sends a `flush` message to its writer. If amqp_channel is in use, that led to a `function_clause` crash.
This commit is contained in:
parent
0ec41c6c41
commit
0ce6ad0f0f
|
@ -384,6 +384,10 @@ init([Driver, Connection, ChannelNumber, Consumer, Identity]) ->
|
||||||
handle_call(open, From, State) ->
|
handle_call(open, From, State) ->
|
||||||
{noreply, rpc_top_half(#'channel.open'{}, none, From, none, noflow, State)};
|
{noreply, rpc_top_half(#'channel.open'{}, none, From, none, noflow, State)};
|
||||||
%% @private
|
%% @private
|
||||||
|
handle_call(flush, _From, State) ->
|
||||||
|
flush_writer(State),
|
||||||
|
{noreply, State};
|
||||||
|
%% @private
|
||||||
handle_call({close, Code, Text}, From, State) ->
|
handle_call({close, Code, Text}, From, State) ->
|
||||||
handle_close(Code, Text, From, State);
|
handle_close(Code, Text, From, State);
|
||||||
%% @private
|
%% @private
|
||||||
|
|
Loading…
Reference in New Issue