Skip to content

Commit

Permalink
Types and cosmetics for amoc_sup and amoc_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Jun 14, 2024
1 parent cbe4265 commit f4b9f81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/amoc_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
%% ------------------------------------------------------------------

%% @private
-spec start_link() -> {ok, pid()}.
-spec start_link() -> gen_server:start_ret().
start_link() ->
gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).

Expand Down
18 changes: 9 additions & 9 deletions src/amoc_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(WORKER(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
-define(SUP(I, Type), {I, {I, start_link, []}, permanent, infinity, Type, [I]}).
-define(WORKER(I), {I, {I, start_link, []}, permanent, 5000, worker, [I]}).
-define(SUP(I), {I, {I, start_link, []}, permanent, infinity, supervisor, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

-spec start_link() -> {ok, Pid :: pid()}.
-spec start_link() -> supervisor:startlink_ret().
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

Expand All @@ -30,10 +30,10 @@ start_link() ->
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 0},
[
?SUP(amoc_users_sup, supervisor),
?SUP(amoc_throttle_sup, supervisor),
?SUP(amoc_coordinator_sup, supervisor),
?WORKER(amoc_controller, worker),
?WORKER(amoc_cluster, worker),
?WORKER(amoc_code_server, worker)
?SUP(amoc_users_sup),
?SUP(amoc_throttle_sup),
?SUP(amoc_coordinator_sup),
?WORKER(amoc_controller),
?WORKER(amoc_cluster),
?WORKER(amoc_code_server)
]}}.

0 comments on commit f4b9f81

Please sign in to comment.