summaryrefslogtreecommitdiffstats
path: root/archives/extend/attachments/20121030/3de26c28/attachment.html
blob: 7246475a6c9a36314df6d40f2782e7d78af77705 (plain) (blame)
1
2
3
4
5
6
7
8
9
<tt>
&lt;div&gt;Hi&nbsp;everyone,&nbsp;newb&nbsp;questions&nbsp;here:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Is&nbsp;the&nbsp;reason&nbsp;why&nbsp;the&nbsp;type&nbsp;specification&nbsp;for&nbsp;the&nbsp;init&nbsp;callback&nbsp;lists&nbsp;various&nbsp;&quot;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation&nbsp;Mono&#39;,Courier,monospace;font-size:12px;line-height:16px;white-space:pre&quot;&gt;{&lt;/span&gt;&lt;span&nbsp;class=&quot;n&quot;&nbsp;style=&quot;margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation&nbsp;Mono&#39;,Courier,monospace;font-size:12px;line-height:16px;white-space:pre&quot;&gt;loop&lt;/span&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation&nbsp;Mono&#39;,Courier,monospace;font-size:12px;line-height:16px;white-space:pre&quot;&gt;,...&quot;&nbsp;&lt;/span&gt;&lt;font&nbsp;face=&quot;arial,&nbsp;helvetica,&nbsp;sans-serif&quot;&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre&quot;&gt;tuples,&nbsp;because&nbsp;a&nbsp;single&nbsp;module&nbsp;can&nbsp;implement&nbsp;cowboy_loop_handler&nbsp;and&nbsp;cowboy_http_handler?&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;<br>
&lt;div&gt;&lt;font&nbsp;face=&quot;arial,&nbsp;helvetica,&nbsp;sans-serif&quot;&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre&quot;&gt;And&nbsp;this&nbsp;way,&nbsp;a&nbsp;dializier&nbsp;warning&nbsp;will&nbsp;not&nbsp;be&nbsp;triggered?&lt;/span&gt;&lt;span&nbsp;style=&quot;color:rgb(51,51,51);font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,204)&quot;&gt;&nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;<br>
&lt;a&nbsp;href=&quot;https://github.com/extend/cowboy/blob/master/src/cowboy_http_handler.erl#L39&quot;&gt;https://github.com/extend/cowboy/blob/master/src/cowboy_http_handler.erl#L39&lt;/a&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Because&nbsp;looking&nbsp;at&nbsp;the&nbsp;handler&nbsp;code,�&lt;a&nbsp;href=&quot;https://github.com/extend/cowboy/blob/master/src/cowboy_protocol.erl#L473&quot;&gt;https://github.com/extend/cowboy/blob/master/src/cowboy_protocol.erl#L473&lt;/a&gt;�if&nbsp;the&nbsp;{loop,&nbsp;*&nbsp;is&nbsp;returned&nbsp;from&nbsp;init,&nbsp;then&nbsp;the�&lt;font&nbsp;face=&quot;arial,&nbsp;helvetica,&nbsp;sans-serif&quot;&gt;&lt;span&nbsp;class=&quot;nf&quot;&nbsp;style=&quot;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold&quot;&gt;handle&lt;/span&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;(&lt;/span&gt;&lt;span&nbsp;class=&quot;nv&quot;&nbsp;style=&quot;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(0,128,128)&quot;&gt;Req&lt;/span&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;,&lt;/span&gt;&lt;span&nbsp;style=&quot;background-color:rgb(248,248,248);color:rgb(51,51,51);font-size:13px;line-height:19px&quot;&gt;&nbsp;&lt;/span&gt;&lt;span&nbsp;class=&quot;nv&quot;&nbsp;style=&quot;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px;color:rgb(0,128,128)&quot;&gt;State&lt;/span&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;)&nbsp;will&nbsp;not&nbsp;be&nbsp;processed.&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;<br>
&lt;div&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation&nbsp;Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;&lt;font&nbsp;face=&quot;arial,&nbsp;helvetica,&nbsp;sans-serif&quot;&gt;Also,&nbsp;is&nbsp;it&nbsp;safe&nbsp;to&nbsp;say&nbsp;that&nbsp;Handler:init&nbsp;is&nbsp;like&nbsp;&quot;before&quot;&nbsp;in&nbsp;lot&#39;s&nbsp;of&nbsp;web&nbsp;frameworks.&nbsp;I&nbsp;can&nbsp;place&nbsp;validation\authentication&nbsp;logic&nbsp;there.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;<br>
&lt;div&gt;&lt;span&nbsp;class=&quot;p&quot;&nbsp;style=&quot;color:rgb(51,51,51);font-family:Consolas,&#39;Liberation&nbsp;Mono&#39;,Courier,monospace;font-size:13px;line-height:19px;margin:0px;padding:0px;border:0px&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Sincerely,&lt;/div&gt;&lt;div&gt;<br>
&lt;br&gt;&lt;/div&gt;&lt;div&gt;-rambocoder&lt;/div&gt;<br>

</tt>