@@ -135,16 +135,28 @@ defmodule Broadcaster.Forwarder do
135
135
end
136
136
137
137
@ impl true
138
- def handle_info ( { :DOWN , _ref , :process , pid , _reason } , % { input_pc: pid } = state ) do
138
+ def handle_info ( { :DOWN , _ref , :process , pid , reason } , % { input_pc: pid } = state ) do
139
+ Logger . info ( "Input process: #{ inspect ( pid ) } exited with reason: #{ inspect ( reason ) } " )
139
140
state = % { state | input_pc: nil , audio_input: nil , video_input: nil }
140
141
{ :noreply , state }
141
142
end
142
143
143
144
@ impl true
144
- def handle_info ( { :DOWN , _ref , :process , pid , _reason } , state )
145
- when is_map_key ( state . outputs , pid ) do
146
- { _ , state } = pop_in ( state , [ :outputs , pid ] )
147
- { :noreply , state }
145
+ def handle_info ( { :DOWN , _ref , :process , pid , reason } , state ) do
146
+ cond do
147
+ Map . has_key? ( state . outputs , pid ) ->
148
+ Logger . info ( "Output process: #{ inspect ( pid ) } exited with reason: #{ inspect ( reason ) } " )
149
+ { _ , state } = pop_in ( state , [ :outputs , pid ] )
150
+ { :noreply , state }
151
+
152
+ pid in state . pending_outputs ->
153
+ Logger . info ( """
154
+ Pending output process: #{ inspect ( pid ) } exited with reason: #{ inspect ( reason ) } \
155
+ """ )
156
+
157
+ pending_outputs = List . delete ( state . pending_outputs , pid )
158
+ { :noreply , % { state | pending_outputs: pending_outputs } }
159
+ end
148
160
end
149
161
150
162
@ impl true
0 commit comments