Sha256: 92297871f2f099534e0a0f84dfd684dbe1907ce958545569befe25441dfe1356
Contents?: true
Size: 1.04 KB
Versions: 62
Compression:
Stored size: 1.04 KB
Contents
-module (pm_event_manager). -include_lib("../include/defines.hrl"). %% API -export([start_link/0, add_handler/1, notify/1]). -define(SERVER, ?MODULE). %%-------------------------------------------------------------------- %% Function: start_link() -> {ok,Pid} | {error,Error} %% Description: Creates an event manager. %%-------------------------------------------------------------------- start_link() -> gen_event:start_link({local, ?SERVER}). %%-------------------------------------------------------------------- %% Function: add_handler(Module) -> ok | {'EXIT',Reason} | term() %% Description: Adds an event handler %%-------------------------------------------------------------------- add_handler(Module) -> gen_event:add_handler(?SERVER, Module, []). %%-------------------------------------------------------------------- %% Function: notify(Event) -> ok | {error, Reason} %% Description: Sends the Event through the event manager. %%-------------------------------------------------------------------- notify(Event) -> gen_event:notify(?SERVER, Event).
Version data entries
62 entries across 62 versions & 3 rubygems