Skip to content
Permalink
Browse files
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.
  • Loading branch information
nickva committed Feb 15, 2018
1 parent 40d019e commit 588d161b981902639577ec4534f550501723a104
Showing 1 changed file with 17 additions and 7 deletions.
@@ -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).

0 comments on commit 588d161

Please sign in to comment.