1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
From essen at ninenines.eu Wed Oct 17 12:16:51 2012
From: essen at ninenines.eu (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=)
Date: Wed, 17 Oct 2012 12:16:51 +0200
Subject: [99s-extend] Welcome!
Message-ID: <[email protected]>
Hello everyone and welcome to the only mailing list dedicated to the
Nine Nines projects including Cowboy, Ranch, Bullet, Sheriff, Farwest
and more!
Feel free to ask any question or request support from the community
directly on this mailing list and we will try to help you as quickly as
possible.
Mailing lists for French and Japanese speakers will be created at a
later date.
Thanks for subscribing!
--
Lo?c Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
From thomas at oinksoft.com Wed Oct 17 13:51:55 2012
From: thomas at oinksoft.com (Thomas Allen)
Date: Wed, 17 Oct 2012 07:51:55 -0400
Subject: [99s-extend] Welcome!
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
Very exciting! Now there's no excuse for asking about Cowboy on the
`erlang-questions' list ;^)
Thomas Allen
On Wed, October 17, 2012 6:16 am, Lo?c Hoguin wrote:
> Hello everyone and welcome to the only mailing list dedicated to the
> Nine Nines projects including Cowboy, Ranch, Bullet, Sheriff, Farwest
> and more!
>
> Feel free to ask any question or request support from the community
> directly on this mailing list and we will try to help you as quickly as
> possible.
>
> Mailing lists for French and Japanese speakers will be created at a
> later date.
>
> Thanks for subscribing!
>
> --
> Lo?c Hoguin
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> http://lists.ninenines.eu:81/listinfo/extend
>
From zabrane3 at gmail.com Tue Oct 30 21:34:35 2012
From: zabrane3 at gmail.com (Zabrane Mickael)
Date: Tue, 30 Oct 2012 21:34:35 +0100
Subject: [99s-extend] Congrats for the new mailinglist
Message-ID: <[email protected]>
Bravo Lo?c,
Regards,
Zabrane
From essen at ninenines.eu Tue Oct 30 21:37:07 2012
From: essen at ninenines.eu (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=)
Date: Tue, 30 Oct 2012 21:37:07 +0100
Subject: [99s-extend] Congrats for the new mailinglist
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
On 10/30/2012 09:34 PM, Zabrane Mickael wrote:
> Bravo Lo?c,
Thanks.
I feel obligated to tell you I started calling you the "congrats guy"
since you congratulate every progress everywhere. :)
--
Lo?c Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
From zabrane3 at gmail.com Tue Oct 30 21:40:27 2012
From: zabrane3 at gmail.com (Zabrane Mickael)
Date: Tue, 30 Oct 2012 21:40:27 +0100
Subject: [99s-extend] Congrats for the new mailinglist
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
Message-ID: <[email protected]>
> I feel obligated to tell you I started calling you the "congrats guy" since you congratulate every progress everywhere. :)
well, you're right ;-)
Regards,
Zabrane
From erlang at rambocoder.com Wed Oct 31 00:38:40 2012
From: erlang at rambocoder.com (rambocoder)
Date: Tue, 30 Oct 2012 19:38:40 -0400
Subject: [99s-extend] cowboy_http_handler type spec
Message-ID: <CAJ0zLROkOMkqD7Mcv-JtSb7tyTWsra4NW-O-KGzBsLmOE3=gig@mail.gmail.com>
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>
From essen at ninenines.eu Wed Oct 31 00:43:06 2012
From: essen at ninenines.eu (=?ISO-8859-1?Q?Lo=EFc_Hoguin?=)
Date: Wed, 31 Oct 2012 00:43:06 +0100
Subject: [99s-extend] cowboy_http_handler type spec
In-Reply-To: <CAJ0zLROkOMkqD7Mcv-JtSb7tyTWsra4NW-O-KGzBsLmOE3=gig@mail.gmail.com>
References: <CAJ0zLROkOMkqD7Mcv-JtSb7tyTWsra4NW-O-KGzBsLmOE3=gig@mail.gmail.com>
Message-ID: <[email protected]>
On 10/31/2012 12:38 AM, rambocoder wrote:
> 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
Yes that's exactly why. Not the best solution but good enough.
> 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.
You have this one if you just want loops:
https://github.com/extend/cowboy/blob/master/src/cowboy_loop_handler.erl
Having an identical init in both allows us to use the 2 handlers without
Dialyzer complaining.
> 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.
Definitely, prepare what you need in init, do what you need to do in
handle and clean up in terminate if needed.
--
Lo?c Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu
|