Trap exit in AMQP 1.0 client proc

Trap exit signal such that terminate/3 gets executed so that
the socket is closed cleanly.
This commit is contained in:
David Ansari 2025-02-13 14:38:44 +00:00
parent ee710ca3f9
commit 3daef04566
1 changed files with 1 additions and 0 deletions

View File

@ -80,6 +80,7 @@ callback_mode() ->
[handle_event_function]. [handle_event_function].
init([Sup, ConnConfig]) when is_map(ConnConfig) -> init([Sup, ConnConfig]) when is_map(ConnConfig) ->
process_flag(trap_exit, true),
Port = maps:get(port, ConnConfig, 5672), Port = maps:get(port, ConnConfig, 5672),
%% combined the list of `addresses' with the value of the original `address' option if provided %% combined the list of `addresses' with the value of the original `address' option if provided
Addresses0 = maps:get(addresses, ConnConfig, []), Addresses0 = maps:get(addresses, ConnConfig, []),