views:

190

answers:

1

I want to implant a framework in Erlang that is similar to Kohana event system. Anyone know how to do that or have any idea? I really like how Kohana is structured.

EDIT

The Kohana event system have been documented here : http://docs.kohanaphp.com/general/events . If I understand it correctly, I can replicate Kohana in Erlang like this:

kohana.erl
event.erl
router.erl
profiler.erl
[system (a directory)]
ready.erl
routing.erl
execute.erl
post_routing.erl
404.erl
pre_controller.erl
post_controller_constructor.erl
post_controller.erl
send_headers.erl
display.erl
shutdown.erl
log.erl
redirect.erl

I'm not sure whether this is better than Python wsgi like Django middleware and there is already ewgi for Erlang. I just want to make a framework for fun. I'm more familiar with Kohana 2 but interested in implanting HMVC or Kohana 3 for erlang.

+1  A: 

Basically the event system in kohana is just a collection of functions/methods to run at a future point in time. I don't know anything about Erlang, but if you can write a collection class, and put function/method callbacks into it, it should be trivial to port the event system over.

zombor