summaryrefslogtreecommitdiff
path: root/erlang/coroner.erl
blob: bdda4437ea7c7e7e5408c3285a1476a388570f54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-module(coroner).
-export([loop/0]).

loop() ->
	process_flag(trap_exit, true),
	receive
		{monitor, Process} ->
			link(Process),
			io:format("Monitoring process.~n"),
			loop();
		{'EXIT', From, Reason} ->
			io:format("The shooter ~p died with reason ~p.", [From, Reason]),
			io:format("Start another one.~n"),
			loop()
	end.