Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 34 lines (29 sloc) 1.456 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
%%%-------------------------------------------------------------------
%%% @author Fernando Benavides <fernando.benavides@inakanetworks.com>
%%% @copyright (C) 2010 InakaLabs S.R.L.
%%% @doc Supervisor for User Processes
%%% @end
%%%-------------------------------------------------------------------
-module(match_stream_user_mgr).

-behaviour(supervisor).

-export([start_link/1, start_user/1, init/1]).

%% ====================================================================
%% External functions
%% ====================================================================
%% @doc Starts the supervisor process
-spec start_link(atom()) -> ignore | {error, term()} | {ok, pid()}.
start_link(Name) ->
  supervisor:start_link({local, Name}, ?MODULE, []).

%% @doc Starts a new client process
-spec start_user(match_stream:user_id()) -> {ok, pid()} | {error, term()}.
start_user(User) ->
  supervisor:start_child(?MODULE, [User]).

%% ====================================================================
%% Server functions
%% ====================================================================
%% @hidden
-spec init([]) -> {ok, {{simple_one_for_one, 100, 1}, [{match_stream_user, {match_stream_user, start_link, []}, transient, brutal_kill, worker, [match_stream_user]}]}}.
init([]) ->
  {ok, {{simple_one_for_one, 100, 1},
        [{match_stream_user, {match_stream_user, start_link, []},
          transient, brutal_kill, worker, [match_stream_user]}]}}.
Something went wrong with that request. Please try again.