Realtime
Web Applications
#whoami
#conceitos
The real-time web is a set of
   technologies and practices that
 enable users to receive information
   as soon as it is published by its
 authors, rather than requiring that
they or their software check a source
       periodically for updates.
The real-time web is a set of
   technologies and practices that
 enable users to receive information
   as soon as it is published by its
 authors, rather than requiring that
they or their software check a source
       periodically for updates.
#AjaxPooling
#FirstTry
#FirstTry
#FirstTry   #SecondTry
#FirstTry   #SecondTry
#Success
#Success
#AjaxPooling
#LongPooling
#Realtime
Realtime
na prática
Realtime
  !=
 Ajax
#exemplos
#ComoFaz
Comet
Comet

HTTP Server Push
Comet

HTTP Server Push   Reverse Ajax
Comet

HTTP Server Push   Reverse Ajax

HTTP Streaming
Comet

HTTP Server Push   Reverse Ajax

HTTP Streaming     Log Pooling
Comet é um saco de
gato. Se refere a todas
   as tentativas de
    Realtime Web
A idéia de fazer
Realtime Web não é
       nova
Netscape 1995
Content-type: multipart/x-mixed-replace;
boundary=separador


     XMLHttpRequest multipart = true
Netscape 1995
Content-type: multipart/x-mixed-replace;
boundary=separador


     XMLHttpRequest multipart = true


                 #IEFail
#Alternativa
Forever Iframe
Forever Iframe
  Connection: keep-alive

Transfer-Encoding: chunked
Forever Iframe
  Connection: keep-alive

Transfer-Encoding: chunked
      #SpinnerFail
     #DelinitadorFail
Gambiarras para todo
 lado. A web não foi
feita inicialmente para
        Realtime
Sockets
Sockets

Websocket
Sockets

Websocket

FlashSocket
Websocket e FlashSocket
  são uma espécie de
    TCP para Web
Websocket
Websocket
    Faz parte da
especificação HTML5
Websocket
     Faz parte da
 especificação HTML5
É a solução ideal para o
       problema
Websocket
     Faz parte da
 especificação HTML5
É a solução ideal para o
       problema
Suportado por poucos
      browsers
FlashSocket
FlashSocket
Faz a mesma coisa
que o Websocket
FlashSocket
  Faz a mesma coisa
  que o Websocket
99% dos computadores
      tem flash
FlashSocket
  Faz a mesma coisa
  que o Websocket
99% dos computadores
      tem flash
    Mais lento para
estabelecer a conexão
Não é qualquer servidor
  que aguenta fazer
    Realtime Web
Uma das opções
para Realtime
#LIVE
Obrigado !!!
    Emerson Macedo
        @emerleite
   http://nodecasts.org
  http://codificando.com

BrazilJS - Node.JS Realtime Web Applications