root/docs/yappo/20080514-soozycon5-yapcasia2008/yapcasia2008-http-engine.pl

Revision 11598, 5.5 kB (checked in by yappo, 8 months ago)

add yapcasia2008 party

Line 
1use strict;
2use warnings;
3use utf8;
4use lib 'lib';
5
6use Plusen;
7
8my $p = Plusen->bootstrap({
9    config => {
10        meta  => {
11            title => 'HTTP::Engine',
12            author => 'Kazuhiro Osawa - ( Yappo )',
13            email => 'yappo <at> shibuya <döt> pl',
14        },
15        plugins => [
16            { module => 'ScriptLoader::Simple' },
17            { module => 'Device::MozRepl', },
18            { module => 'Device::Term', },
19            { module => 'Device::Growl', },
20#            { module => 'Device::ControlFromFile', config => { path => '/tmp/devsumi-ctl.txt' } },
21        ],
22    },
23});
24
25
26__DATA__
27
28===
29title: who are yappo
30list:
31 - at the Infomarks Corp.
32 - 'PAUSE ID: YAPPO'
33 - CodeRepos maintainer
34 - It gets drunk.
35
36===
37title: and
38
39===
40title: 征夷大将軍
41img: seiitaishougun.jpg
42
43===
44title: Attention for Japanese
45
46===
47title: SoozyConも次のtalkで最後になって、いよいよYAPC::Asiaが開幕します
48
49===
50title: 前夜祭もまだまだ時間あるので
51
52===
53title: ゆっくりしていってね!!!
54img: yukkuri.png
55
56===
57title: でもあまりゆっくりしすぎて21時過ぎても撤収できないと
58
59===
60title: すごい怒られるから21時までに会場閉められるように協力してね!
61
62===
63title: こんな人が怒っちゃうよ!
64
65===
66title: id:dropdb
67img: dropdb.png
68
69===
70title: talk start
71
72===
73title: "What's HTTP::Engine?"
74
75===
76title: HTTP::Engine is
77list:
78 - WSGI on Perl, Rack on Perl
79 - Simple
80 - Poweful
81 - no Pluggable ;-)
82 - use Moose;
83 - Catalyst::Engine + Cat::Req + Cat::Res
84 - + WSGI Power + α
85
86===
87title: code
88code: |
89 use HTTP::Engine;
90 my $e = HTTP::Engine->new(
91  interface => {
92    module => 'ServerSimple',
93    args   => { port => 824242 },
94    request_handler => \&handler,
95  }
96 );
97 sub handler {
98  my $c = shift;
99  $c->res->body(Dumper($c->req);
100 }
101
102===
103title: HTTP::Engine has not
104list:
105 - Plugin
106 - Hook Point
107 - WSGI like Middleware
108
109===
110title: but
111list:
112 - WSGI like Middleware layer is
113 - HTTP::Engine::Middleware namespace
114 - Middleware is uncool naming?
115 - give me! cool name!
116
117===
118title: HTTP::Engine has
119list:
120 - HTTP Server Interfaces
121 - Request Object Builder
122 - Response Manager
123 - "MiddleWare's Manager"
124 - some moose roles
125
126===
127title: Layer
128code: |
129 +-------------------------------+
130 |         Application           |
131 +-------------------------------+
132 | ↑        Middleware        ↓  |
133 +-------------------------------+
134 | ↑  Request   |  Response   ↓  |
135 | ↑   Builder  |     Writer  ↓  |
136 +-------------------------------+
137 | ↑  read API  |  write API  ↓  |
138 |          Interface            |
139 +-------------------------------+
140 |         HTTP Server           |
141 +-------------------------------+
142
143===
144title: Interface is HTTP Server Driver
145
146===
147title: Catalyst::Engine::FastCGI = HTTP::Engine::Interface::FCGI
148
149===
150title: Middleware
151list:
152 - App(Middle(Middle(HTTP::Engine)))
153 - using add_around_method_modifier
154
155===
156title: code
157code: |
158 use HTTP::Engine middlewares => [qw(
159  DebugScreen
160  ModuleReload
161 )];
162 my $e = HTTP::Engine->new(
163  interface => {
164    module => 'ServerSimple',
165    args   => { port => 824242 },
166    request_handler => \&handler,
167  }
168 );
169 sub handler { "snip" }
170
171===
172title: very simple
173
174===
175title: Middleware functions only by this.
176
177===
178title: Middleware has two hook point
179list:
180 - wrap
181 - wrap is around to request_handler
182 - setup
183 - setup is Middleware setup phase
184 -  for create lazy attributes
185
186===
187title: Middleware wrap code
188code: |
189 package
190  HTTP::Engine::Middleware::ModuleReload;
191 use Moose;
192 use Module::Reload;
193 sub wrap {
194     my ($next, $rp, $c) = @_;
195     Module::Reload->check;
196     $next->($rp, $c);
197 }
198 1;
199
200===
201title: Middleware setup code 1/2
202code: |
203 package
204  HTTP::Engine::Middleware::MobileAttribute;
205 use Moose;
206 use HTTP::MobileAttribute;
207 use HTTP::Engine::Request;
208
209 sub setup {
210  my $meta = HTTP::Engine::Request->meta;
211  $meta->make_mutable;
212
213===
214title: Middleware setup code 2/2
215code: |
216 #
217  $meta->add_attribute(
218   mobile_attribute => (
219    is => 'ro', isa => 'Object', lazy => 1,
220    default => sub {
221     my $self = shift;
222     $self->{mobile_attribute} =
223      HTTP::MobileAttribute
224       ->new($self->headers);
225    },
226  ));
227  $meta->make_immutable;
228 }1;
229
230===
231title: HTTP::Engine want
232list:
233 - new Interfaces...
234 - (Danga::Socket xmpp stomp smtp)
235 - ''
236 - more Practicable Interfaces
237 - (POE Standalone)
238 - ''
239 - Practicable and Excellent Middlewares
240 - ''
241 - more Documentation and testing...
242
243===
244title: now status
245list:
246 - version 0.0.x is a concept release
247 - 0.0.6 on CPAN (but no Moose)
248 - use Class::Component Moosenize on CPAN
249 - ''
250 - use Moose on trunk now
251 - as such, spec has decided
252 - maybe
253
254===
255title: HTTP::Engine on the future
256list:
257 - some company use
258 -  For instance, sponsor of YAPC::Asia :-)
259 - ''
260 - replaced from Sledge::Engine
261 - replaced from Catalyst::Engine
262 - ''
263 - and import to Jifty
264 -  it works on weekend hackathon, maybe
265
266===
267title: development team
268code: |
269 repository on CodeRepos.org
270 #coderepos@freenode (japanese)
271 #http-engine@irc.perl.org (official)
272
273 committers
274  yappo, tokuhirom, Daisuke Maki, hidek
275  dann, nyarla, marcus
276
277 gave knowledge
278  mst, jesse, hanekomu, #catalyst-dev members
279  miyagawa, kazuho, Topia, charsbar
280  typester, hirose31 and more mongers
281
282===
283title: reference
284code: |
285 http://svn.coderepos.org/share/docs/yappo
286  /20080422-catalystcon1/catalystcon.pl
287
288 http://svn.coderepos.org/share/lang/perl
289  /HTTP-Engine
290
291 http://coderepos.org/share/wiki
292  /HTTP%3A%3AEngine
293
294 http://http-engine.g.hatena.ne.jp/
295
296 and  tag: http-engine
297
298===
299title: thank you.
Note: See TracBrowser for help on using the browser.