From 6bcbbf7526a9ac426e627826f5304ed1c3051f2a Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Sun, 20 May 2018 15:50:48 +0100 Subject: Use maps for child spec example --- priv/templates/sup.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index a2e7209..e2fa05e 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -26,7 +26,8 @@ start_link() -> %% Supervisor callbacks %%==================================================================== -%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} +%% Child :: #{id => Id, start => {M, F, A}} +%% Optional keys are restart, shutdown, type, modules. init([]) -> {ok, { {one_for_all, 0, 1}, []} }. -- cgit v1.1 From 1b02e78fae8a50b77a7b68544f00208353a23cb3 Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Sun, 20 May 2018 16:11:21 +0100 Subject: add tuple and comment for prior to OTP 18 --- priv/templates/sup.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index e2fa05e..0db7155 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -28,6 +28,8 @@ start_link() -> %% Child :: #{id => Id, start => {M, F, A}} %% Optional keys are restart, shutdown, type, modules. +%% Before OTP 18 tuples must be used to specify a child. e.g. +%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} init([]) -> {ok, { {one_for_all, 0, 1}, []} }. -- cgit v1.1