diff options
author | Guillermo Ramos | 2012-05-11 00:49:36 +0200 |
---|---|---|
committer | Guillermo Ramos | 2012-05-11 00:49:36 +0200 |
commit | 5d8c20c0a91dbd58a1676581c4374ecb67e639a7 (patch) | |
tree | 15ef8efe0a214a088274c1db58408caeff29fdd2 /erlang/coroner.erl | |
parent | 67a898893884f229d64886a220ba422dd0d66e78 (diff) | |
download | 7l-5d8c20c0a91dbd58a1676581c4374ecb67e639a7.tar.gz |
[Erlang] Día 3 (1/2)
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. |