aboutsummaryrefslogtreecommitdiffstats
path: root/test/supervisor_separate.erl
blob: 5f1f32618a79a0db59b1521957fb6a4a605a7c10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-module(supervisor_separate).
-behavior(supervisor).
-behavior(ranch_protocol).

-export([start_link/4]).
-export([init/1]).

start_link(Ref, Socket, Transport, Opts) ->
	{ok, SupPid} = supervisor:start_link(?MODULE, []),
	{ok, ConnPid} = supervisor:start_child(SupPid,
		{echo_protocol, {echo_protocol, start_link, [Ref, Socket, Transport, Opts]},
			temporary, 5000, worker, [echo_protocol]}),
	{ok, SupPid, ConnPid}.

init([]) ->
	{ok, {{one_for_one, 1, 1}, []}}.