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:
Michal Kuratczyk 2025-04-28 15:02:35 +02:00
parent 0ec41c6c41
commit 0ce6ad0f0f
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -384,6 +384,10 @@ init([Driver, Connection, ChannelNumber, Consumer, Identity]) ->
handle_call(open, From, State) ->
{noreply, rpc_top_half(#'channel.open'{}, none, From, none, noflow, State)};
%% @private
handle_call(flush, _From, State) ->
flush_writer(State),
{noreply, State};
%% @private
handle_call({close, Code, Text}, From, State) ->
handle_close(Code, Text, From, State);
%% @private