a reviravolta do
desenvolvimento web
Wallace Reis

YAPC::BR - São Paulo/2012
eu
@wreis - wallace@reis.me
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
eu
@wreis - wallace@reis.me
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
eu
@wreis - wallace@reis.me
vitória.pm
yelster digital
123people.com - frontend lead-dev
123pages.fr
reporama.com
caótico!
...de escrever...
Catalyst

Tripletail

Noe

Maypole

Konstrukt

Schenker

Mason

Reaction

Tatsumaki

Mojo

Jifty

Amon

...
...de executar...
CGI
FastCGI
mod_perl
standalone HTTP
CGI.pm
Jifty, CGI::Application, Spoon...
mod_perl
Mason, Sledge, PageKit...
com adaptadores
Maypole, 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/ou
non-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($bod...
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
retur...
package My::Middleware;
use
use
use
use

strict;
warnings;
Plack::Request;
parent ‘Plack::Middleware’;

sub call {
my ( $s...
Plack::Util::response_cb
$ plackup app.psgi
HTTP::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...
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’, ...;
enabl...
Plack::App::CGIBin
Plack::App::WrapCGI
Plack::App::FakeApache
Plack::Test
Test::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
wallace@reis.me

YAPC::BR::2012

https:/
/metacpan.org/module/PSGI
http:/
/plackp...
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Upcoming SlideShare
Loading in...5
×

A reviravolta do desenvolvimento web

473

Published on

YAPC::BR::2012 em São Paulo

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
473
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

A reviravolta do desenvolvimento web

  1. 1. a reviravolta do desenvolvimento web Wallace Reis YAPC::BR - São Paulo/2012
  2. 2. eu @wreis - wallace@reis.me vitória.pm yelster digital 123people.com - frontend lead-dev 123pages.fr reporama.com
  3. 3. eu @wreis - wallace@reis.me vitória.pm yelster digital 123people.com - frontend lead-dev 123pages.fr reporama.com
  4. 4. eu @wreis - wallace@reis.me vitória.pm yelster digital 123people.com - frontend lead-dev 123pages.fr reporama.com
  5. 5. caótico!
  6. 6. ...de escrever... Catalyst Tripletail Noe Maypole Konstrukt Schenker Mason Reaction Tatsumaki Mojo Jifty Amon Sledge Cyclone3 Apache2::WebApp Spoon WebGUI Web::Simple PageKit OpenInteract Apache2::REST AxKit Squatting SweetPea Egg Dancer Hydrant Gantry CGI::Application Titanium Continuity Nanoa CGI.pm Solstice Ark Mojolicious Angelos
  7. 7. ...de executar... CGI FastCGI mod_perl standalone HTTP
  8. 8. CGI.pm Jifty, CGI::Application, Spoon...
  9. 9. mod_perl Mason, Sledge, PageKit...
  10. 10. com adaptadores Maypole, Catalyst, Squatting...
  11. 11. HTTP::Engine
  12. 12. PSGI Internet
  13. 13. PSGI Perl Web Server Gateway Interface Tatsuhiko Miyagawa WSGI (Python) e Rack (Ruby)
  14. 14. PSGI Perl Web Server Gateway Interface Tatsuhiko Miyagawa WSGI (Python) e Rack (Ruby)
  15. 15. PSGI Perl Web Server Gateway Interface Tatsuhiko Miyagawa WSGI (Python) e Rack (Ruby)
  16. 16. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  17. 17. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  18. 18. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  19. 19. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  20. 20. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  21. 21. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  22. 22. my $app = sub { my $env = shift; return [ 200, [‘Content-Type’ => ‘text/plain’], [‘Hello World’] ]; };
  23. 23. Streaming e/ou non-blocking?
  24. 24. my $app = sub { my $env = shift; return sub { my $respond = shift; # ... delegar $respond->( [$status, $headers, $body] ); }; };
  25. 25. my $app = sub { my $env = shift; return sub { my $respond = shift; my $w = $respond->([$status, $headers]); $w->write($body); ... $w->close; }; };
  26. 26. PSGI ...
  27. 27. PSGI SPDY?
  28. 28. Plack?
  29. 29. Plack? PSGI toolkit
  30. 30. HTTP::Server::PSGI
  31. 31. Plack::Component
  32. 32. Plack::(Request|Response)
  33. 33. Plack::Middleware
  34. 34. 220+ Middleware
  35. 35. my $app = sub { my $env = shift; return [ $status, $headers, $body ]; }; my $mw = sub { ... };
  36. 36. 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; };
  37. 37. package My::Middleware; use use use use strict; warnings; Plack::Request; 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;
  38. 38. Plack::Util::response_cb
  39. 39. $ plackup app.psgi HTTP::Server::PSGI: Accepting connections at http:/ /0:5000/
  40. 40. $ plackup -s $SERVER app.psgi
  41. 41. $ plackup -s FCGI app.psgi
  42. 42. $ plackup -s Starman app.psgi
  43. 43. 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;
  44. 44. Plack::App
  45. 45. Plack::App::File
  46. 46. Plack::App::Directory
  47. 47. Plack::App::Proxy
  48. 48. Plack::App::FCGIDispatcher
  49. 49. Plack::App::URLMap
  50. 50. 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;
  51. 51. Plack::App::CGIBin Plack::App::WrapCGI
  52. 52. Plack::App::FakeApache
  53. 53. Plack::Test Test::WWW::Mechanize::PSGI
  54. 54. 25+ Frameworks e Toolkits 35+ Webservers e Handlers
  55. 55. 25+ Frameworks e Toolkits 35+ Webservers e Handlers
  56. 56. CGI Plack::Handler::CGI
  57. 57. mod_perl Plack::Handler::Apache(1|2)
  58. 58. FastCGI Plack::Handler::FCGI ::FCGI::EV ::FCGI::Async ::AnyEvent::FCGI fastpass
  59. 59. FastCGI Plack::Handler::FCGI ::FCGI::EV ::FCGI::Async ::AnyEvent::FCGI fastpass
  60. 60. FastCGI Plack::Handler::FCGI ::FCGI::EV ::FCGI::Async ::AnyEvent::FCGI fastpass
  61. 61. Servidores HTTP autônomos HTTP::Server::PSGI HTTP::Server::Simple::PSGI Starman Starlet
  62. 62. Servidores HTTP autônomos HTTP::Server::PSGI HTTP::Server::Simple::PSGI Starman Starlet
  63. 63. Servidores HTTP autônomos HTTP::Server::PSGI HTTP::Server::Simple::PSGI Starman Starlet
  64. 64. Servidores HTTP autônomos HTTP::Server::PSGI HTTP::Server::Simple::PSGI Starman Starlet
  65. 65. Servidores HTTP autônomos (async) Feersum Twiggy
  66. 66. Perlbal::Plugin::PSGI mod_psgi nginx_mod_psgi Mongrel2
  67. 67. Obrigado! Perguntas? Wallace Reis @wreis wallace@reis.me YAPC::BR::2012 https:/ /metacpan.org/module/PSGI http:/ /plackperl.org/ http:/ /blog.plackperl.org/ IRC#plack
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×