couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [1/2] config commit: updated refs/heads/master to fc5594c
Date Thu, 15 Feb 2018 16:14:25 GMT
Repository: couchdb-config
Updated Branches:
  refs/heads/master 40d019e43 -> fc5594cb8


Use callback directive for config_listener behaviour

This knocks out a few dialyzer errors such as:

`Callback info about the config_listener behaviour is not available`

It is also more descriptive as it specifies types and argument names for each
callback.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-config/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-config/commit/588d161b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-config/tree/588d161b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-config/diff/588d161b

Branch: refs/heads/master
Commit: 588d161b981902639577ec4534f550501723a104
Parents: 40d019e
Author: Nick Vatamaniuc <vatamane@apache.org>
Authored: Thu Feb 15 01:30:44 2018 -0500
Committer: Nick Vatamaniuc <vatamane@apache.org>
Committed: Thu Feb 15 01:41:24 2018 -0500

----------------------------------------------------------------------
 src/config_listener.erl | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-config/blob/588d161b/src/config_listener.erl
----------------------------------------------------------------------
diff --git a/src/config_listener.erl b/src/config_listener.erl
index 22ce366..756609b 100644
--- a/src/config_listener.erl
+++ b/src/config_listener.erl
@@ -19,17 +19,27 @@
 -export([start/2]).
 -export([start/3]).
 
--export([behaviour_info/1]).
-
 %% Required gen_event interface
 -export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2,
     code_change/3]).
 
-behaviour_info(callbacks) ->
-    [{handle_config_change,5},
-     {handle_config_terminate, 3}];
-behaviour_info(_) ->
-    undefined.
+
+-callback handle_config_change(
+    Sec :: string(),
+    Key :: string(),
+    Value :: string(),
+    Persist :: boolean(),
+    State :: term()
+) ->
+    {ok, term()} | remove_handler.
+
+-callback handle_config_terminate(
+    Subscriber :: pid(),
+    Reason :: term(),
+    State :: term()
+) ->
+    term().
+
 
 start(Module, State) ->
     start(Module, Module, State).


Mime
View raw message