Real-TimeWeb APIs
Ryan J. McDonough
@damnhandy | http://damnhandy.com
Options
Protocols
• Long-Polling
• PubSubHubbub
• WebHooks
• WebSockets
• Server-Sent Events
Services
• Pusher
• Kaazing
•...
Promising Directions
• PubSubHubbub
• Server-Sent Events (SSE)
• WebSockets + “Something Else”
PubSubHubbub
WebSockets
• STOMP +WebSockets is an interesting idea
• No ideal way for indicating the sub-protocol used by
theWebSocket
...
Server-Sent Events
Connection: keep-alive
Content-Type: text/event-stream
Date: Sat, 21 Sep 2013 13:31:59 GMT
data: {"msg"...
WhatWould Browser Do?
<script>
var source = new EventSource(’/updates');
source.addEventListener('add',
addHandler,
false)...
WhatWould PSHB Do?
Link: <http://example.com/events>;
rel=”hub";
Ideas: Links for SSE
Link: <http://example.com/events>; rel="notifications";
type="text/event-stream;data='application/ld+...
Links forWebSockets +
“Something”
Link: <ws://example.com/events>;
rel=”websocket/something";
type=“application/ld+json";
Upcoming SlideShare
Loading in …5
×

Real-Time Web APIs

1,096 views

Published on

My presentation from RESTFest 2013 on real-time push notifications in hypermedia-driven APIs.

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

No Downloads
Views
Total views
1,096
On SlideShare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
5
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • The browser typically gets code
  • Real-Time Web APIs

    1. 1. Real-TimeWeb APIs Ryan J. McDonough @damnhandy | http://damnhandy.com
    2. 2. Options Protocols • Long-Polling • PubSubHubbub • WebHooks • WebSockets • Server-Sent Events Services • Pusher • Kaazing • PubNub
    3. 3. Promising Directions • PubSubHubbub • Server-Sent Events (SSE) • WebSockets + “Something Else”
    4. 4. PubSubHubbub
    5. 5. WebSockets • STOMP +WebSockets is an interesting idea • No ideal way for indicating the sub-protocol used by theWebSocket • No way to express what media type is coming over the wire • Not sure bi-direction communication is necessary
    6. 6. Server-Sent Events Connection: keep-alive Content-Type: text/event-stream Date: Sat, 21 Sep 2013 13:31:59 GMT data: {"msg": "First message"}nn event: userlogonn data: {"username": "John123"}nn event: updaten data: {"username": "John123", "emotion": "happy"}nn
    7. 7. WhatWould Browser Do? <script> var source = new EventSource(’/updates'); source.addEventListener('add', addHandler, false); </script>
    8. 8. WhatWould PSHB Do? Link: <http://example.com/events>; rel=”hub";
    9. 9. Ideas: Links for SSE Link: <http://example.com/events>; rel="notifications"; type="text/event-stream;data='application/ld+json'";
    10. 10. Links forWebSockets + “Something” Link: <ws://example.com/events>; rel=”websocket/something"; type=“application/ld+json";

    ×