diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-10-04 06:04:19 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-10-04 06:04:19 +0200 |
commit | cabc0995c0e0964ecbef18470c6a483022879071 (patch) | |
tree | ea78fc03c11302f847b429fe417cdde412923613 /src/core/ephraim_account_event_proxy.erl | |
parent | 2b99ed6fd9cf84c405f426ea0914b233b1f40ef1 (diff) | |
download | ephraim-cabc0995c0e0964ecbef18470c6a483022879071.tar ephraim-cabc0995c0e0964ecbef18470c6a483022879071.zip |
Major reorganisation of the core, still unfinished...
Diffstat (limited to 'src/core/ephraim_account_event_proxy.erl')
-rw-r--r-- | src/core/ephraim_account_event_proxy.erl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/ephraim_account_event_proxy.erl b/src/core/ephraim_account_event_proxy.erl new file mode 100644 index 0000000..d9cf94e --- /dev/null +++ b/src/core/ephraim_account_event_proxy.erl @@ -0,0 +1,27 @@ +-module(ephraim_account_event_proxy). +-behaviour(gen_event). + +-export([start/1]). +-export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]). + +start(EventManager) -> + gen_event:add_handler(EventManager, ?MODULE, foo_account). + +init(Account) -> + {ok, Account}. + +handle_event({view_update, Event}, Account) -> + ephraim:notify({view_update, {account, Account, Event}}), + {ok, Account}; + +handle_event(_Event, Account) -> + {ok, Account}. + +handle_call(_Msg, Account) -> + {noreply, Account}. +handle_info(_Msg, Account) -> + {ok, Account}. +terminate(_Reason, _Account) -> + ok. +code_change(_OldVersion, Account, _Extra) -> + {ok, Account}. |