diff --git a/src/emqttd.erl b/src/emqttd.erl index 23db807cc..63b53d4e1 100644 --- a/src/emqttd.erl +++ b/src/emqttd.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io) %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -14,10 +14,12 @@ %% limitations under the License. %%-------------------------------------------------------------------- -%% Facade Module for The EMQ Broker +%% @doc EMQ Main Module. -module(emqttd). +-author("Feng Lee "). + -include("emqttd.hrl"). -include("emqttd_protocol.hrl"). @@ -138,23 +140,23 @@ subscriber_down(Subscriber) -> -spec(hook(atom(), function(), list(any())) -> ok | {error, any()}). hook(Hook, Function, InitArgs) -> - emqttd_hook:add(Hook, Function, InitArgs). + emqttd_hooks:add(Hook, Function, InitArgs). -spec(hook(atom(), function(), list(any()), integer()) -> ok | {error, any()}). hook(Hook, Function, InitArgs, Priority) -> - emqttd_hook:add(Hook, Function, InitArgs, Priority). + emqttd_hooks:add(Hook, Function, InitArgs, Priority). -spec(unhook(atom(), function()) -> ok | {error, any()}). unhook(Hook, Function) -> - emqttd_hook:delete(Hook, Function). + emqttd_hooks:delete(Hook, Function). -spec(run_hooks(atom(), list(any())) -> ok | stop). run_hooks(Hook, Args) -> - emqttd_hook:run(Hook, Args). + emqttd_hooks:run(Hook, Args). -spec(run_hooks(atom(), list(any()), any()) -> {ok | stop, any()}). run_hooks(Hook, Args, Acc) -> - emqttd_hook:run(Hook, Args, Acc). + emqttd_hooks:run(Hook, Args, Acc). %%-------------------------------------------------------------------- %% Debug diff --git a/src/emqttd_hooks.erl b/src/emqttd_hooks.erl index 675698688..ce2691894 100644 --- a/src/emqttd_hooks.erl +++ b/src/emqttd_hooks.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io) %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ %% limitations under the License. %%-------------------------------------------------------------------- --module(emqttd_hook). - --author("Feng Lee "). +-module(emqttd_hooks). -behaviour(gen_server). +-author("Feng Lee "). + %% Start -export([start_link/0]). @@ -40,10 +40,6 @@ -define(HOOK_TAB, mqtt_hook). -%%-------------------------------------------------------------------- -%% Start API -%%-------------------------------------------------------------------- - start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).