A reviravolta do desenvolvimento web
-
Upload
wallace-reis -
Category
Technology
-
view
388 -
download
0
description
Transcript of A reviravolta do desenvolvimento web
a reviravolta do desenvolvimento web
Wallace Reis
YAPC::BR - São Paulo/2012
eu
@wreis - [email protected]
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
eu
@wreis - [email protected]
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
eu
@wreis - [email protected]
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
caótico!
Catalyst
Maypole
Mason
Mojo
Sledge
Spoon
PageKit
AxKit
Egg
Gantry
Continuity
Solstice
Mojolicious
Tripletail
Konstrukt
Reaction
Jifty
Cyclone3
WebGUI
OpenInteract
Squatting
Dancer
CGI::Application
Nanoa
Ark
Angelos
Noe
Schenker
Tatsumaki
Amon
Apache2::WebApp
Web::Simple
Apache2::REST
SweetPea
Hydrant
Titanium
CGI.pm
...de escrever...
...de executar...
CGI
FastCGI
mod_perl
standalone HTTP
CGI.pmJifty, CGI::Application, Spoon...
mod_perlMason, Sledge, PageKit...
com adaptadoresMaypole, Catalyst, Squatting...
HTTP::Engine
PSGI
Internet
PSGI
Perl Web Server Gateway Interface
Tatsuhiko Miyagawa
WSGI (Python) e Rack (Ruby)
PSGI
Perl Web Server Gateway Interface
Tatsuhiko Miyagawa
WSGI (Python) e Rack (Ruby)
PSGI
Perl Web Server Gateway Interface
Tatsuhiko Miyagawa
WSGI (Python) e Rack (Ruby)
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ];};
Streaming e/ounon-blocking?
my $app = sub { my $env = shift; return sub { my $respond = shift; # ... delegar $respond->( [$status, $headers, $body] ); };};
my $app = sub { my $env = shift; return sub { my $respond = shift; my $w = $respond->([$status, $headers]); $w->write($body); ... $w->close; };};
PSGI
...
PSGI
SPDY?
Plack?
Plack?
PSGI toolkit
HTTP::Server::PSGI
Plack::Component
Plack::(Request|Response)
Plack::Middleware
220+ Middleware
my $app = sub { my $env = shift; return [ $status, $headers, $body ];};
my $mw = sub { ... };
my $mw = sub { my $env = shift; # ...faz algo com (ou no) $env my $res = $app->($env); # faz algo com a (ou na) $res return $res;};
package My::Middleware;
use strict;use warnings;use Plack::Request;use parent ‘Plack::Middleware’;
sub call { my ( $self, $env ) = @_; # ...faz algo com (ou no) $env # my $req = Plack::Request->new($env); my $res = $app->($env); # faz algo com a (ou na, ou nova) $res # my $res = $req->new_response; return $res;}
1;
Plack::Util::response_cb
$ plackup app.psgiHTTP::Server::PSGI: Accepting connections
at http://0:5000/
$ plackup -s $SERVER app.psgi
$ plackup -s FCGI app.psgi
$ plackup -s Starman app.psgi
use Plack::Builder;
my $app = MyApp->psgi_app; # ->to_psgi; ->to_app; ->as_psgi; etc
builder { enable ‘Static’, ...;
enable_if { $_[0]->{'PATH_INFO'} =~ m{^/admin} } 'Auth::Htpasswd', ...;
$app;};
Plack::App
Plack::App::File
Plack::App::Directory
Plack::App::Proxy
Plack::App::FCGIDispatcher
Plack::App::URLMap
use Plack::Builder;
my $app = MyApp->psgi_app; # ->to_psgi; ->to_app; ->as_psgi; etc
builder { enable ‘Static’, ...;
enable_if { $_[0]->{'PATH_INFO'} =~ m{^/admin} } 'Auth::Htpasswd', ...;
mount ‘/foo’ => $foo_app;
mount ‘http://www.example.com/’ => builder { enable ‘AccessLog’, ...; $bar_app; };
mount ‘/’ => $app;};
Plack::App::CGIBinPlack::App::WrapCGI
Plack::App::FakeApache
Plack::TestTest::WWW::Mechanize::PSGI
25+ Frameworks e Toolkits
35+ Webservers e Handlers
25+ Frameworks e Toolkits
35+ Webservers e Handlers
CGI
Plack::Handler::CGI
mod_perl
Plack::Handler::Apache(1|2)
FastCGI
Plack::Handler::FCGI
::FCGI::EV
::FCGI::Async
::AnyEvent::FCGI
fastpass
FastCGI
Plack::Handler::FCGI
::FCGI::EV
::FCGI::Async
::AnyEvent::FCGI
fastpass
FastCGI
Plack::Handler::FCGI
::FCGI::EV
::FCGI::Async
::AnyEvent::FCGI
fastpass
Servidores HTTP autônomos
HTTP::Server::PSGI
HTTP::Server::Simple::PSGI
Starman
Starlet
Servidores HTTP autônomos
HTTP::Server::PSGI
HTTP::Server::Simple::PSGI
Starman
Starlet
Servidores HTTP autônomos
HTTP::Server::PSGI
HTTP::Server::Simple::PSGI
Starman
Starlet
Servidores HTTP autônomos
HTTP::Server::PSGI
HTTP::Server::Simple::PSGI
Starman
Starlet
Servidores HTTP autônomos (async)
Feersum
Twiggy
Perlbal::Plugin::PSGI
mod_psgi
nginx_mod_psgi
Mongrel2
Obrigado! Perguntas?Wallace Reis @wreis
YAPC::BR::2012
https://metacpan.org/module/PSGIhttp://plackperl.org/
http://blog.plackperl.org/IRC#plack