From 5d8c20c0a91dbd58a1676581c4374ecb67e639a7 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Fri, 11 May 2012 00:49:36 +0200 Subject: [Erlang] Día 3 (1/2) --- erlang/coroner.erl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 erlang/coroner.erl (limited to 'erlang/coroner.erl') 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. -- cgit v1.2.3