A reviravolta do desenvolvimento web

  • 271 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
271
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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