aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2010-06-08 23:19:13 +0300
committerHenrik Nord <[email protected]>2011-10-07 17:17:06 +0200
commit1d3544d9b5c4bc2cad99b220f44aa370703dbc6b (patch)
treefc09bb430e0286e2ebc86487a69e4c7e0282d1e0 /lib/inets
parent9bb4ba879b613fc1986ac37c027a16884f3814fe (diff)
downloadotp-1d3544d9b5c4bc2cad99b220f44aa370703dbc6b.tar.gz
otp-1d3544d9b5c4bc2cad99b220f44aa370703dbc6b.tar.bz2
otp-1d3544d9b5c4bc2cad99b220f44aa370703dbc6b.zip
Add callback specs to inets_service module following possibly deprecated comments
Diffstat (limited to 'lib/inets')
-rw-r--r--lib/inets/src/inets_app/inets_service.erl28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/inets/src/inets_app/inets_service.erl b/lib/inets/src/inets_app/inets_service.erl
index e9eb9892f2..f89dac195c 100644
--- a/lib/inets/src/inets_app/inets_service.erl
+++ b/lib/inets/src/inets_app/inets_service.erl
@@ -20,24 +20,20 @@
-module(inets_service).
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{start_standalone, 1},
- {start_service, 1},
- {stop_service, 1},
- {services, 0},
- {service_info, 1}];
-behaviour_info(_) ->
- undefined.
-
%% Starts service stand-alone
%% start_standalone(Config) -> % {ok, Pid} | {error, Reason}
%% <service>:start_link(Config).
+-callback start_standalone(Config :: term()) ->
+ {ok, pid()} | {error, Reason :: term()}.
+
%% Starts service as part of inets
%% start_service(Config) -> % {ok, Pid} | {error, Reason}
%% <service_sup>:start_child(Config).
+
+-callback start_service(Config :: term()) ->
+ {ok, pid()} | {error, Reason :: term()}.
+
%% Stop service
%% stop_service(Pid) -> % ok | {error, Reason}
%% <service_sup>:stop_child(maybe_map_pid_to_other_ref(Pid)).
@@ -51,6 +47,9 @@ behaviour_info(_) ->
%% Error
%% end.
+-callback stop_service(Service :: term()) ->
+ ok | {error, Reason :: term()}.
+
%% Returns list of running services. Services started as stand alone
%% are not listed
%% services() -> % [{Service, Pid}]
@@ -59,7 +58,12 @@ behaviour_info(_) ->
%% [{httpc, Pid} || {_, Pid, _, _} <-
%% supervisor:which_children(httpc_profile_sup)].
+-callback services() ->
+ [{Service :: term(), pid()}].
-%% service_info() -> [{Property, Value}] | {error, Reason}
+%% service_info() -> {ok, [{Property, Value}]} | {error, Reason}
%% ex: httpc:service_info() -> [{profile, ProfileName}]
%% httpd:service_info() -> [{host, Host}, {port, Port}]
+
+-callback service_info(Service :: term()) ->
+ {ok, [{Property :: term(), Value :: term()}]} | {error, Reason :: term()}.