[99s-extend] Mandatory init/3 and optional handle/2 and terminate/3
Paulo F. Oliveira
paulo.ferraz.oliveira at gmail.com
Wed Jun 4 23:37:14 CEST 2014
Hello.
You wrote here <http://ninenines.eu/docs/en/cowboy/HEAD/manual/cowboy_rest/>
that
"The only mandatory callback is init/3, needed to perform the protocol
upgrade."
In my code I have only this function for the protocol upgrade:
init({_TransportName, _ProtocolName}, _Req, []) ->
{upgrade, protocol, cowboy_rest}.
On the other hand, when compiling, I get the following warnings:
src/handler_transactions.erl:3: Warning: undefined callback function
handle/2 (behaviour 'cowboy_http_handler')
src/handler_transactions.erl:3: Warning: undefined callback function
terminate/3 (behaviour 'cowboy_http_handler')
Is this the expected behavior? I know I _can_ ignore the warnings, but not
if I want to use Erlang compiler option warnings_as_errors, for example.
Many thanks.
- Paulo F. Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20140604/407d3443/attachment.html>
More information about the Extend
mailing list