diff options
Diffstat (limited to 'erlang/coroner.erl')
-rw-r--r-- | erlang/coroner.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/erlang/coroner.erl b/erlang/coroner.erl new file mode 100644 index 0000000..bdda443 --- /dev/null +++ b/erlang/coroner.erl @@ -0,0 +1,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. |