PageRenderTime 62ms CodeModel.GetById 55ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/erlv8_sup.erl

http://github.com/beamjs/erlv8
Erlang | 27 lines | 9 code | 9 blank | 9 comment | 0 complexity | 3135e1bef895842edcdd189e4f3610cf MD5 | raw file
 1-module(erlv8_sup).
 2
 3-behaviour(supervisor2).
 4
 5%% API
 6-export([start_link/0]).
 7
 8%% Supervisor callbacks
 9-export([init/1]).
10
11%% Helper macro for declaring children of supervisor
12-define(CHILD(I, Restart, Type), {I, {I, start_link, []}, Restart, 5000, Type, [I]}).
13
14%% ===================================================================
15%% API functions
16%% ===================================================================
17
18start_link() ->
19    supervisor2:start_link({local, ?MODULE}, ?MODULE, []).
20
21%% ===================================================================
22%% Supervisor callbacks
23%% ===================================================================
24
25init([]) ->
26    {ok, { {simple_one_for_one_terminate, 5, 10}, [?CHILD(erlv8_vm,transient,worker)]} }.
27