[99s-extend] cowboy_http_handler type spec

rambocoder erlang at rambocoder.com
Wed Oct 31 00:38:40 CET 2012


Hi everyone, newb questions here:

Is the reason why the type specification for the init callback lists
various "{loop,..." tuples, because a single module can implement
cowboy_loop_handler and cowboy_http_handler?
And this way, a dializier warning will not be triggered?
https://github.com/extend/cowboy/blob/master/src/cowboy_http_handler.erl#L39

Because looking at the handler code,
https://github.com/extend/cowboy/blob/master/src/cowboy_protocol.erl#L473 if
the {loop, * is returned from init, then the handle(Req, State) will not be
processed.

Also, is it safe to say that Handler:init is like "before" in lot's of web
frameworks. I can place validation\authentication logic there.

Sincerely,

-rambocoder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20121030/3de26c28/attachment.html>


More information about the Extend mailing list