Current section
Files
Jump to
Current section
Files
src/opcua_server_sup.erl
-module(opcua_server_sup).
-behaviour(supervisor).
%%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% API Functions
-export([start_link/0]).
%% Behaviour supervisor callback functions
-export([init/1]).
%%% API FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%%% BEHAVIOUR supervisor CALLBACK FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
init([]) ->
{ok, {#{strategy => one_for_all}, [
worker(opcua_server_space, []),
worker(opcua_server_registry, [#{}]),
supervisor(opcua_server_session_sup, [])
]}}.
%%% INTERNAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
worker(Module, Args) ->
#{id => Module, start => {Module, start_link, Args}}.
supervisor(Module, Args) ->
#{id => Module, type => supervisor, start => {Module, start_link, Args}}.