Libre Conference
LSL - UTN-FRA
31 de octubre de 2015
Gabriel Montes
@gab_montes
Gmail
Google Docs
Facebook Messenger
Cloud9
Botones
Spinners
Conexión
Actualizaciones optimistas
Responsiveness
Percepción
Redes móviles
Dispositivos móviles
Conflictos
Deltas
Actualización automática
Latencia
Consulta/Respuesta
Cliente/Servidor
OWA
XMLHttpRequest
AJAX
Actualización automática
Latencia
Servidor > Cliente
Conexiones HTTP
Recursos
TCP
Upgrade
Mensajes
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
Origin: http://example.com
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=
Sec-WebSocket-Protocol: chat
Tráfico
Recursos
Performance
Proxies
Redes móviles
Redes corporativas
Chrome 4 / 16
Firefox 4 / 11
IE 10
iOS 4.3 / 6
Android 4.4
JavaScript / Node.JS + Socket.IO
Java / Jetty/Netty
.Net / SignalR
Phyton / Tornado
Ruby / Faye
PHP / Ratchet
Pusher
Meteor
Firebase
Express + AngularJS
JavaScript (V8)
Basado en eventos
I/O no bloqueante
Bidireccional
WebSocket
JSONP/XHR polling
Reconexión
Multiplexado
// Servidor
io.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
// Cliente
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
SPA
MVC / MV*
<div>
<label>Nombre:</label>
<input type="text" ng-model="vm.name" placeholder="Ingrese su nombre">
<hr>
<h1 ng-show="vm.name">¡Hola {{vm.name}}!</h1>
</div>
https://github.com/gabmontes/realtime-polls-demo
The Future of Real-Time with Guillermo Rauch
Guillermo Rauch - The need for speed - Single-page apps, Optimistic UIs, Reactivity
Choosing your Realtime Web App Tech Stack - Phil Leggetter
http://rauchg.com/2014/7-principles-of-rich-web-applications/
http://socket.io/blog/introducing-socket-io-1-0/