Comments on: An introduction to gen_event: Account Notifications http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/ Linking You to Erlang Sun, 22 May 2011 00:00:28 +0000 http://wordpress.org/?v=2.6.1 By: jimmyrr http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-9718 jimmyrr Fri, 10 Jul 2009 23:30:12 +0000 http://spawnlink.com/?p=66#comment-9718 I think there's a bug in your skeleton file - the handle_call function should return a tuple with a first value of 'reply' - and not 'ok'. Btw - thanks - awesome blog. I think there’s a bug in your skeleton file - the handle_call function should return a tuple with a first value of ‘reply’ - and not ‘ok’. Btw - thanks - awesome blog.

]]>
By: Arek http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-606 Arek Tue, 04 Nov 2008 10:21:39 +0000 http://spawnlink.com/?p=66#comment-606 Mitchell, Thank you for this effort, you have unique style in conveying your idea... I wish you write a book about OTP in the same writing style Mitchell,
Thank you for this effort, you have unique style in conveying your idea…
I wish you write a book about OTP in the same writing style

]]>
By: Ricardo http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-157 Ricardo Tue, 30 Sep 2008 19:29:32 +0000 http://spawnlink.com/?p=66#comment-157 Matt, Indeed, in my case, the handler did never work until I called it explicitly in the server init: init(_Args) -> eb_event_manager:start_link(), eb_event_manager:add_handler(eb_withdrawal_handler), {ok, dict:new()}. Matt,

Indeed, in my case, the handler did never work until I called it explicitly in the server init:

init(_Args) ->
eb_event_manager:start_link(),
eb_event_manager:add_handler(eb_withdrawal_handler),
{ok, dict:new()}.

]]>
By: Ricardo http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-133 Ricardo Sun, 28 Sep 2008 11:20:40 +0000 http://spawnlink.com/?p=66#comment-133 Thanks Mitchell for this great series. I've noticed that the skeleton does not include "-behaviour(gen_event)." as the other previos ones. Is that correct? Also, a great topic for future articles could be the interaction between an Erlang program with another application via sockets. Why? many times there are some applications that can be controlled via its own API using sockets but fail when the number of open connections is too high. I think that an Erlang broker could be put in the middle; open one connection to the application and receive the request from the application to forward them to the app; and to react to the application responses. Thanks Mitchell for this great series.

I’ve noticed that the skeleton does not include “-behaviour(gen_event).” as the other previos ones. Is that correct?

Also, a great topic for future articles could be the interaction between an Erlang program with another application via sockets. Why? many times there are some applications that can be controlled via its own API using sockets but fail when the number of open connections is too high. I think that an Erlang broker could be put in the middle; open one connection to the application and receive the request from the application to forward them to the app; and to react to the application responses.

]]>
By: Mitchell http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-78 Mitchell Mon, 15 Sep 2008 02:10:21 +0000 http://spawnlink.com/?p=66#comment-78 Alain, This would definitely be a great use for gen_event. :) The basic premise for gen_event is to send everything that could potentially be loggable to it, and let the handlers handle the logic and figuring out what to do with all this data. Mitchell Alain,

This would definitely be a great use for gen_event. :) The basic premise for gen_event is to send everything that could potentially be loggable to it, and let the handlers handle the logic and figuring out what to do with all this data.

Mitchell

]]>
By: Alain O'Dea http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-77 Alain O'Dea Mon, 15 Sep 2008 01:58:42 +0000 http://spawnlink.com/?p=66#comment-77 Would it make sense to use gen_event to capture a log of transactions for ErlyBank with something like mnesia? My first impression is that it would work really nicely. Would it make sense to use gen_event to capture a log of transactions for ErlyBank with something like mnesia? My first impression is that it would work really nicely.

]]>
By: Mitchell http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-52 Mitchell Wed, 10 Sep 2008 20:19:23 +0000 http://spawnlink.com/?p=66#comment-52 It doesn't! Good catch! I was just testing this in the shell and always did it manually. I suppose a logical place to put this, at this point in the code, would be in eb_server after it initializes the the event manager. :-\ But, in a future article, I will decouple most of these components and have a general startup script which will do this. :) It doesn’t! Good catch! I was just testing this in the shell and always did it manually.

I suppose a logical place to put this, at this point in the code, would be in eb_server after it initializes the the event manager. :-\

But, in a future article, I will decouple most of these components and have a general startup script which will do this. :)

]]>
By: Matt http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-51 Matt Wed, 10 Sep 2008 20:07:24 +0000 http://spawnlink.com/?p=66#comment-51 Where does eb_event_manager:add_handler get called? Where does eb_event_manager:add_handler get called?

]]>
By: Michael Greene http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-50 Michael Greene Wed, 10 Sep 2008 18:30:15 +0000 http://spawnlink.com/?p=66#comment-50 Thanks for these articles, they are really filling a huge void. Thanks for these articles, they are really filling a huge void.

]]>
By: zamous http://spawnlink.com/articles/an-introduction-to-gen_event-account-notifications/#comment-49 zamous Wed, 10 Sep 2008 16:01:05 +0000 http://spawnlink.com/?p=66#comment-49 Wow, you are so prolific. This is great stuff. You should write a book on OTP. Can't wait for supervisors. Wow, you are so prolific. This is great stuff. You should write a book on OTP. Can’t wait for supervisors.

]]>