ForeverConfused
ForeverConfused

Reputation: 1777

Why should I monitor processes and not just link and trap exits?

Besides avoiding propagated kills, is there any advantage to monitoring over just trapping exits?

Upvotes: 5

Views: 809

Answers (2)

Steve Vinoski
Steve Vinoski

Reputation: 20024

Unlike trapping exits, monitoring allows you to easily keep tabs on processes that you have not spawned, and without having to trap exits. Also, links are bidirectional, so if you link to some process but you die first and it's not trapping exits, it dies too. Monitoring prevents this unintended coupling.

Upvotes: 11

Related Questions