I have seen
terminate/2 to be discouraged for channels in several places. Even the Phoenix docs say that trapping exits in a channel is discouraged.
However, I have not seen a convincing example that demonstrates exactly why is this a bad idea, and I do not want to cargo cult this.
Of course, a part of me thinks that
terminate/2 is a first-class callback of some OTP behaviours, and that if in practice it may not work very well —as some people put it,— it would not be provided in the first place and everyone would be writing monitors.
Could anyone provide a concrete reason to not use
terminate/2 + trapping exits in channels?