fewd/src/fd_clients.erl
Peter Harpending 71909e79b0 initial commit;
2025-09-16 14:41:39 -07:00

49 lines
1.4 KiB
Erlang

%%% @doc
%%% front end web development lab Client Service Supervisor
%%%
%%% This is the service-level supervisor of the system. It is the parent of both the
%%% client connection handlers and the client manager (which manages the client
%%% connection handlers). This is the child of fd_sup.
%%%
%%% See: http://erlang.org/doc/apps/kernel/application.html
%%% @end
-module(fd_clients).
-vsn("0.1.0").
-behavior(supervisor).
-author("Peter Harpending <peterharpending@qpq.swiss>").
-copyright("Peter Harpending <peterharpending@qpq.swiss>").
-license("BSD-2-Clause-FreeBSD").
-export([start_link/0]).
-export([init/1]).
-spec start_link() -> {ok, pid()}.
%% @private
%% This supervisor's own start function.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, none).
-spec init(none) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
%% @private
%% The OTP init/1 function.
init(none) ->
RestartStrategy = {rest_for_one, 1, 60},
ClientMan = {fd_client_man,
{fd_client_man, start_link, []},
permanent,
5000,
worker,
[fd_client_man]},
ClientSup = {fd_client_sup,
{fd_client_sup, start_link, []},
permanent,
5000,
supervisor,
[fd_client_sup]},
Children = [ClientSup, ClientMan],
{ok, {RestartStrategy, Children}}.