SlideShare a Scribd company logo
Makoto




           RTW – WTF?
         Real Time Web – What’s That For?
         Makoto Inoue - Martyn Loughran
Who are we?
RTW
Exciting
Real Time Web - What's that for?
The big guys already do it


  Google wave
  Facebook live feed
  Twitter
This is our story
Martyn

         Once upon a time...




                               November 2009
Visualise web traffic
    Rack           Sinatra Stats
 Existing app       Collector




                Fancy Visualization
Real Time Web - What's that for?
Under the hood
Nginx HTTP_Push_Module
Long polling
Push handled by separate component
Worked, but fiddly to setup
Makoto
         WebSockets




         http://www.flickr.com/photos/lenaah/2939721384/




                                                          December 2009
WebSockets
HTML5 sub standard
Allows Socket in the browser
Now supported in the ‘non-shite’
browsers
 Chrome & Webkit (nightly)
 There is a library for flash emulation
Ajax vs Comet vs WebSocket
                                         Server
Ajax
(Polling)
                                         Client
                                         Server
Comet
(Long polling)
                                         Client

                                         Server


WebSocket
                                         Client
Javascript API
Martyn
         Server Side




         http://www.flickr.com/photos/lenaah/2939721384/




                                                          December 2009
Fun problems

Concurrent
Stateful
Low latency (sometimes)
Asynchronous servers

  Make all IO non-blocking
  Single thread
  Efficient CPU utilisation
Simple example
Other options
em-websocket
cramp
sunshowers
node.js (js)
Example: Drawing




  http://github.com/markevans/websocket_test
class Connection
          class << self
            def add(websocket)
              connections << websocket
            end

            def all
              connections
            end

            def remove(websocket)
              connections.delete(websocket)
            end

            private

            def connections
              @connections ||= []
            end
          end
        end


Keep connection objects in memory
EventMachine.run {
  EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 3001) do |ws|
      ws.onopen {
        puts "WebSocket connection open"
        Connection.add(ws)
      }

          ws.onclose { Connection.remove(ws) }

          ws.onmessage { |data|
            Connection.all.each do |ws|
              ws.send(data) unless ws == self
            end
          }
    end
}
Demo
We wanted to add it
  to everything




    http://www.flickr.com/photos/10737604@N02/1673136876/

                                                   January 2010
Mandays
Work Schedule Management
TrueStory
Backlog Management
Problems
Data gets stale
People make conflicting changes
This discourages collaboration
Requirements

We didn’t want to re-write everything
Reusable by many apps
Really simple
Our solution
+
Real Time Web - What's that for?
Real Time Web - What's that for?
Real Time Web - What's that for?
Real Time Web - What's that for?
Real Time Web - What's that for?
Look Ma




http://www.flickr.com/photos/jeremystockwell/2691931146/   February 2010
Real Time Web - What's that for?
Real Time Web - What's that for?
Case Study

Adding real time to TrueStory
Data Flow
Inspired by JS events
 Trigger in on place
 Bind in another
$('form#sprint').submit(function(){
  var url = $(this).attr('action');
  var data = $(this).serialize();

  $.ajax({                    def create
    url: url,                   @sprint = Sprint.new(params)
    data: data                  @sprint.save
  });
});                             Pusher['project-1'].trigger
                              ('sprints-create', @sprint.attributes)
                              end

pusher.bind('sprints-create', function(attributes) {
   addSprint(attributes);
})
Stateful client
http://github.com/benpickles/js-model
In memory object client side
Asynchronous persistence (e.g. to a
REST API)
Used on TrueStory - let me show you
var sprint = new Sprint(
   {                          def create
     name: "My Sprint Name"     @sprint = Sprint.new(params)
   }                            @sprint.save
);
sprint.save();                  Pusher['project-1'].trigger
                              ('sprints-create', @sprint.attributes)
                                respond_to do |format|
                                  format.js {
                                    render :json => @sprint.to_json
                                  }
                                end
                              end


pusher.bind('sprints-create', function(attributes) {
   var sprint = new Sprint(attributes);
   Sprint.add(sprint);
})
Makoto
         Look Ma




                   March 2010
Task Management Board
Real Time Web - What's that for?
Debugging
Real Time Web - What's that for?
Booking
Real Time Web - What's that for?
Wife Notifier
Real Time Web - What's that for?
Summary




http://www.flickr.com/photos/blueju38/2767019065/
RTW
            (our take)
More than just chat
Another layer of progressive enhancement
Work well with other HTML5 features
Resources
    WebSockets
•   http://dev.w3.org/html5/websockets

•   http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75

•   http://blog.new-bamboo.co.uk/2009/12/30/brain-dump-of-real-time-web-rtw-and-websocket


    Javascript (Client side)
•   http://blog.new-bamboo.co.uk/2010/2/10/json-event-based-convention-websockets

•   http://blog.new-bamboo.co.uk/2010/3/7/the-js-model-layer


    Ruby (Server side)
•   http://github.com/igrigorik/em-websocket

•   http://github.com/lifo/cramp

•   http://rainbows.rubyforge.org/sunshowers
One more thing...
Questions ?



http://pusherapp.com
    Get hooked!

More Related Content

What's hot (20)

PDF
Introduction to VueJS & Vuex
Bernd Alter
 
PPTX
OpenStack Glance
Deepti Ramakrishna
 
PPTX
Meteor presentation
Andy Bute
 
PDF
Ускоряем загрузку картинок вебсокетами
2ГИС Технологии
 
PDF
Vue.js
BADR
 
PDF
Vue 淺談前端建置工具
andyyou
 
PDF
Backbone.js slides
Ambert Ho
 
PDF
[20180226] I understand webpacker perfectly
Yuta Suzuki
 
PPTX
Introduction to Backbone.js
Pragnesh Vaghela
 
PDF
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
PDF
Universal JS Applications with React
Thanh Trần Trọng
 
PPTX
Vue business first
Vitalii Ratyshnyi
 
PDF
Realtime web apps rails
Ambert Ho
 
PDF
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
 
PPTX
Introduction to node.js GDD
Sudar Muthu
 
PPT
The Mobile Development Landscape
Ambert Ho
 
PDF
Vue, vue router, vuex
Samundra khatri
 
PPTX
Openstack glance
SHAMEEM F
 
PDF
The Complementarity of React and Web Components
Andrew Rota
 
PPTX
Whirlwind tour of activiti 7
Ryan Dawson
 
Introduction to VueJS & Vuex
Bernd Alter
 
OpenStack Glance
Deepti Ramakrishna
 
Meteor presentation
Andy Bute
 
Ускоряем загрузку картинок вебсокетами
2ГИС Технологии
 
Vue.js
BADR
 
Vue 淺談前端建置工具
andyyou
 
Backbone.js slides
Ambert Ho
 
[20180226] I understand webpacker perfectly
Yuta Suzuki
 
Introduction to Backbone.js
Pragnesh Vaghela
 
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Universal JS Applications with React
Thanh Trần Trọng
 
Vue business first
Vitalii Ratyshnyi
 
Realtime web apps rails
Ambert Ho
 
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
 
Introduction to node.js GDD
Sudar Muthu
 
The Mobile Development Landscape
Ambert Ho
 
Vue, vue router, vuex
Samundra khatri
 
Openstack glance
SHAMEEM F
 
The Complementarity of React and Web Components
Andrew Rota
 
Whirlwind tour of activiti 7
Ryan Dawson
 

Viewers also liked (12)

PPT
Best Of National Geographic 18407
Laura Pessarrodona Silvestre
 
PPT
Remax Listing Presentation
markfortson
 
PPT
Ball State Martial Arts Club Eng213 Promo
kaedenboroug
 
PDF
A 2D Spatial Light Modulator for spatio-temporal shaping
Sentewolf
 
PPT
Shift Happens 23665
Omar Francisco Ochoa Salinas, MBA
 
PPT
Falke School
guestf0ff5e
 
PPT
Reagan 1
guest1fe91e
 
PDF
getting the experience right
Ryan Nance
 
PDF
Bestemming zeezeilen 2008
Sentewolf
 
PPT
15 Amazing Illusions Pictures 1203685223642925 3
Omar Francisco Ochoa Salinas, MBA
 
PPT
User Experience Design at Bernard Hodes Group
Ryan Nance
 
PPTX
Subjects repositories supporting open access
jkelly
 
Best Of National Geographic 18407
Laura Pessarrodona Silvestre
 
Remax Listing Presentation
markfortson
 
Ball State Martial Arts Club Eng213 Promo
kaedenboroug
 
A 2D Spatial Light Modulator for spatio-temporal shaping
Sentewolf
 
Falke School
guestf0ff5e
 
Reagan 1
guest1fe91e
 
getting the experience right
Ryan Nance
 
Bestemming zeezeilen 2008
Sentewolf
 
15 Amazing Illusions Pictures 1203685223642925 3
Omar Francisco Ochoa Salinas, MBA
 
User Experience Design at Bernard Hodes Group
Ryan Nance
 
Subjects repositories supporting open access
jkelly
 
Ad

Similar to Real Time Web - What's that for? (20)

PDF
Comet with node.js and V8
amix3k
 
PDF
Intro to WebSockets and Comet
dylanks
 
PPTX
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
PDF
Real time web apps
Sepehr Rasouli
 
PDF
Real-Time with Flowdock
Flowdock
 
PPTX
WebSocket protocol
Kensaku Komatsu
 
KEY
Pushing the web — WebSockets
Roland M
 
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
PDF
WebSocket Push Fallback - Transcript.pdf
ShaiAlmog1
 
PPTX
Connected Web Systems
Damir Dobric
 
PDF
Firebase introduction
Mu Chun Wang
 
KEY
Socket applications
João Moura
 
PDF
Introduction to WebSockets
Gunnar Hillert
 
PDF
Server-Side Programming Primer
Ivano Malavolta
 
KEY
Realtime rocks
Vanbosse
 
PDF
Pusherアプリの作り方
Jun OHWADA
 
PPT
Web-Socket
Pankaj Kumar Sharma
 
PDF
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
PDF
Кирилл Латыш "ERP on Websockets"
Fwdays
 
PDF
WebSocket
njamnjam
 
Comet with node.js and V8
amix3k
 
Intro to WebSockets and Comet
dylanks
 
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
Real time web apps
Sepehr Rasouli
 
Real-Time with Flowdock
Flowdock
 
WebSocket protocol
Kensaku Komatsu
 
Pushing the web — WebSockets
Roland M
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
WebSocket Push Fallback - Transcript.pdf
ShaiAlmog1
 
Connected Web Systems
Damir Dobric
 
Firebase introduction
Mu Chun Wang
 
Socket applications
João Moura
 
Introduction to WebSockets
Gunnar Hillert
 
Server-Side Programming Primer
Ivano Malavolta
 
Realtime rocks
Vanbosse
 
Pusherアプリの作り方
Jun OHWADA
 
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
Кирилл Латыш "ERP on Websockets"
Fwdays
 
WebSocket
njamnjam
 
Ad

Recently uploaded (20)

PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
July Patch Tuesday
Ivanti
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 

Real Time Web - What's that for?