142
OMG! Someone broke the internet! James Lewis Monday, 24 May 2010

Websockets - OMG! Someone broke the internet!

Embed Size (px)

DESCRIPTION

This deck looks at some of the applications of the websockets API. There is an example use case and then I explore the implications for the web of using this tech

Citation preview

Page 1: Websockets - OMG! Someone broke the internet!

OMG! Someone broke the internet!James Lewis

Monday, 24 May 2010

Page 2: Websockets - OMG! Someone broke the internet!

• Introductions

• So what are Websockets then?

• Interactions on the World Wide Web

• Implications for building application

• Recap

Monday, 24 May 2010

Page 3: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 4: Websockets - OMG! Someone broke the internet!

Developer

XP Coach

Sometime architect

James Lewis

Monday, 24 May 2010

Page 5: Websockets - OMG! Someone broke the internet!

201020001990

A brief history of push to the browser

Monday, 24 May 2010

Page 6: Websockets - OMG! Someone broke the internet!

201020001990

late ’80’s...Al Gore invents the interweb

A brief history of push to the browser

Monday, 24 May 2010

Page 7: Websockets - OMG! Someone broke the internet!

201020001990

1995...Push inventedmultipart/x-mixed-replace

A brief history of push to the browser

Monday, 24 May 2010

Page 8: Websockets - OMG! Someone broke the internet!

201020001990

1996...MS start using pushXMLHTTP

A brief history of push to the browser

Monday, 24 May 2010

Page 9: Websockets - OMG! Someone broke the internet!

201020001990

~2003...MozillaXHR

A brief history of push to the browser

Monday, 24 May 2010

Page 10: Websockets - OMG! Someone broke the internet!

201020001990

2006...The term COMET is coined

A brief history of push to the browser

Monday, 24 May 2010

Page 11: Websockets - OMG! Someone broke the internet!

201020001990

2008...HTML 5 (draft)

A brief history of push to the browser

Monday, 24 May 2010

Page 12: Websockets - OMG! Someone broke the internet!

201020001990

Dec 2009...Chrome build 4.0.249.0Websocket support added

A brief history of push to the browser

Monday, 24 May 2010

Page 13: Websockets - OMG! Someone broke the internet!

201020001990

A brief history of push to the browser

Monday, 24 May 2010

Page 14: Websockets - OMG! Someone broke the internet!

An ExampleGrid computing

Monday, 24 May 2010

Page 15: Websockets - OMG! Someone broke the internet!

An ExampleGrid computing

What do you need to create a grid?

Monday, 24 May 2010

Page 16: Websockets - OMG! Someone broke the internet!

An ExampleGrid computing

Clients that are capable of exectuting arbitrary algorithms

What do you need to create a grid?

Monday, 24 May 2010

Page 17: Websockets - OMG! Someone broke the internet!

An ExampleGrid computing

Clients that are capable of exectuting arbitrary algorithms

A co-ordinating service to push code / data to clients and assemble the results

What do you need to create a grid?

Monday, 24 May 2010

Page 18: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 19: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 20: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

Anatomy of a traditional grid client

Monday, 24 May 2010

Page 21: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Publisher> A co-ordinating service to push code / data and assemble the results

Anatomy of a traditional grid client

Monday, 24 May 2010

Page 22: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Listener>

<Publisher>

Clients that are capable of exectuting arbitrary algorithms

A co-ordinating service to push code / data and assemble the results

Anatomy of a traditional grid client

Monday, 24 May 2010

Page 23: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 24: Websockets - OMG! Someone broke the internet!

SKYNET

Monday, 24 May 2010

Page 25: Websockets - OMG! Someone broke the internet!

SKYNETSKYNETwe-run-any-code.com

Monday, 24 May 2010

Page 26: Websockets - OMG! Someone broke the internet!

How does we-run-any-code.com work?

Monday, 24 May 2010

Page 27: Websockets - OMG! Someone broke the internet!

How does we-run-any-code.com work?

Well, it doesn’t at the moment...

Monday, 24 May 2010

Page 28: Websockets - OMG! Someone broke the internet!

How does we-run-any-code.com work?

Well, it doesn’t at the moment...

But if it did...

Monday, 24 May 2010

Page 29: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Listener>

<Publisher>

Monday, 24 May 2010

Page 30: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Listener>

<Publisher>

Browser

js engine

app

we-run-any-code.com

Monday, 24 May 2010

Page 31: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Listener>

<Publisher>

Browser

js engine

app

we-run-any-code.com

Map

Monday, 24 May 2010

Page 32: Websockets - OMG! Someone broke the internet!

OS

JVM

app

client - server

<Listener>

<Publisher>

Browser

js engine

app

we-run-any-code.com

Map

Reduce

Monday, 24 May 2010

Page 33: Websockets - OMG! Someone broke the internet!

What do you need to create a grid?

Monday, 24 May 2010

Page 34: Websockets - OMG! Someone broke the internet!

Execute arbitrary code

Co-ordinating service

Push code to client

What do you need to create a grid?

Monday, 24 May 2010

Page 35: Websockets - OMG! Someone broke the internet!

eval(string)Execute arbitrary code

Co-ordinating service

Push code to client

What do you need to create a grid?

Monday, 24 May 2010

Page 36: Websockets - OMG! Someone broke the internet!

eval(string)

Umm, a web server?

Execute arbitrary code

Co-ordinating service

Push code to client Any ideas?

What do you need to create a grid?

Monday, 24 May 2010

Page 37: Websockets - OMG! Someone broke the internet!

“The HTML5 initiative introduced the Web Socket interface -- now developed as an independent specification -- which defines a full-duplex communications channel that operates over a single socket and is exposed via a JavaScript interface in compliant browsers. “Source: websockets.org

Monday, 24 May 2010

Page 38: Websockets - OMG! Someone broke the internet!

[Constructor(in DOMString url, in optional DOMString protocol)]interface WebSocket {

<snip>

// networking attribute Function onopen; attribute Function onmessage; attribute Function onerror; attribute Function onclose; boolean send(in DOMString data); void close();};<snip>

Monday, 24 May 2010

Page 39: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

Monday, 24 May 2010

Page 40: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

GET /nextJob HTTP/1.1Host: werunanycode.comConnection: UpgradeUpgrade: WebSocket

Monday, 24 May 2010

Page 41: Websockets - OMG! Someone broke the internet!

HTTP/1.1 101 WebSocket Protocol HandshakeUpgrade: WebSocketConnection: Upgrade

WebsocketsInteractions on the World Wide Web

GET /nextJob HTTP/1.1Host: werunanycode.comConnection: UpgradeUpgrade: WebSocket

Monday, 24 May 2010

Page 42: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

Monday, 24 May 2010

Page 43: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

websocket: function(url, s) {<snip>

$(ws) .bind('open', $.websocketSettings.open) .bind('close', $.websocketSettings.close) .bind('message', $.websocketSettings.message) .bind('message', function(e){ var m = $.evalJSON(e.originalEvent.data); var h = $.websocketSettings.events[m.type]; if (h) h.call(this, m); }); <snip> }

Monday, 24 May 2010

Page 44: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

public class ClientMessageCallback implements WebSocket {

private Outbound outbound;

public void onConnect(Outbound outbound) { }

public void onDisconnect() { }

public void sendMessage(String message) { try { outbound.sendMessage(message); } catch (IOException e) { throw new RuntimeException(e); } }}

Monday, 24 May 2010

Page 45: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

Monday, 24 May 2010

Page 46: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

Monday, 24 May 2010

Page 47: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

{"type":"message", "data": {"algo":"2+2"}}

Monday, 24 May 2010

Page 48: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

{"type":"message", "data": {"algo":"2+2"}}

Monday, 24 May 2010

Page 49: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

{"type":"message", "data": {"algo":"2+2"}}

{"type":"answer", "data": "4"}

Monday, 24 May 2010

Page 50: Websockets - OMG! Someone broke the internet!

WebsocketsInteractions on the World Wide Web

{"type":"message", "data": {"algo":"2+2"}}

{"type":"answer", "data": "4"}

Monday, 24 May 2010

Page 51: Websockets - OMG! Someone broke the internet!

What did we just see?

Monday, 24 May 2010

Page 52: Websockets - OMG! Someone broke the internet!

What did we just see?

Raw TCP/IP based sockets

Monday, 24 May 2010

Page 53: Websockets - OMG! Someone broke the internet!

What did we just see?

Raw TCP/IP based sockets

Message exchange

Monday, 24 May 2010

Page 54: Websockets - OMG! Someone broke the internet!

What did we just see?

Raw TCP/IP based sockets

Message exchange

State transition logic in the client

Monday, 24 May 2010

Page 55: Websockets - OMG! Someone broke the internet!

What did we just see?

Raw TCP/IP based sockets

Message exchange

State transition logic in the client

The building blocks of the World Wide Web

Monday, 24 May 2010

Page 56: Websockets - OMG! Someone broke the internet!

What did we just see?

Raw TCP/IP based sockets

Message exchange

State transition logic in the client

The building blocks of the World Wide Webthick clien

ts

^the World Wide Web

Monday, 24 May 2010

Page 57: Websockets - OMG! Someone broke the internet!

OS

JVM

app

Browser

js engine

app<Listener>

<Publisher>

<Listener>

<Publisher>

See? It’s a thick client!

Monday, 24 May 2010

Page 58: Websockets - OMG! Someone broke the internet!

But that doesn’t break the internet does it?

Monday, 24 May 2010

Page 59: Websockets - OMG! Someone broke the internet!

But that doesn’t break the internet does it?

well, what is the internet?

Monday, 24 May 2010

Page 60: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 61: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 62: Websockets - OMG! Someone broke the internet!

Characteristics of the interwebernet

identification of resources

manipulation of resources through representations

self-descriptive messages

HATEOAS

Source: Fielding, Roy. 2000. Architectural Styles and the Design of Network-based Software Architectures. PhD diss

layered system

Monday, 24 May 2010

Page 63: Websockets - OMG! Someone broke the internet!

Image of ISP Backbone Connectivity reflecting Skitter Path Data - 1998 http://www.caida.org/Tools/Skitter/viz9808.html

Monday, 24 May 2010

Page 64: Websockets - OMG! Someone broke the internet!

Feature #1- scalability

Monday, 24 May 2010

Page 65: Websockets - OMG! Someone broke the internet!

Feature #1- scalability“The internet trades latency for scalability”Dr Jim Webber

Monday, 24 May 2010

Page 66: Websockets - OMG! Someone broke the internet!

Feature #1- scalability“The internet trades latency for scalability”

“Push trades scalability for latency”

Dr Jim Webber

Monday, 24 May 2010

Page 67: Websockets - OMG! Someone broke the internet!

Feature #1- scalability“The internet trades latency for scalability”

“Push trades scalability for latency”

Dr Jim Webber

Me

Monday, 24 May 2010

Page 68: Websockets - OMG! Someone broke the internet!

This may suprise you but the web doesn’t look like thisMonday, 24 May 2010

Page 69: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 70: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 71: Websockets - OMG! Someone broke the internet!

Client cache

Monday, 24 May 2010

Page 72: Websockets - OMG! Someone broke the internet!

Client cache

Proxy cache

Monday, 24 May 2010

Page 73: Websockets - OMG! Someone broke the internet!

Client cache

Proxy cache CDN

Monday, 24 May 2010

Page 74: Websockets - OMG! Someone broke the internet!

Client cache

Proxy cache CDN Infrastructurecaches

Monday, 24 May 2010

Page 75: Websockets - OMG! Someone broke the internet!

Client cache

Proxy cache CDN Infrastructurecaches

Reverse proxycache

Monday, 24 May 2010

Page 76: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 77: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 78: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 79: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 80: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 81: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 82: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 83: Websockets - OMG! Someone broke the internet!

And Websockets?

Monday, 24 May 2010

Page 84: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 85: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 86: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 87: Websockets - OMG! Someone broke the internet!

Feature #2 - availability

Monday, 24 May 2010

Page 88: Websockets - OMG! Someone broke the internet!

Feature #2 - availability“The internet is not a five nines fabric”Urs Hölzle

Monday, 24 May 2010

Page 89: Websockets - OMG! Someone broke the internet!

Feature #2 - availability“The internet is not a five nines fabric”

“If you are going to build an internet scale application using push, you’d better not count on it’s availability”

Urs Hölzle

Monday, 24 May 2010

Page 90: Websockets - OMG! Someone broke the internet!

Feature #2 - availability“The internet is not a five nines fabric”

“If you are going to build an internet scale application using push, you’d better not count on it’s availability”

Urs Hölzle

Me

Monday, 24 May 2010

Page 91: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 92: Websockets - OMG! Someone broke the internet!

Pakistan suffers a near complete Internet outage as a submarine cable becomes defective (Jun)

2005

Monday, 24 May 2010

Page 93: Websockets - OMG! Someone broke the internet!

The Middle East, India, and other parts of Africa and Asia see a major degradation in Internet service, including outages, after several undersea cables carrying Internet traffic to the region are cut within 1 week (Jan-Feb)

2008

YouTube becomes unreacheable for a couple of hours after Pakistan Telecom starts an unauthorized announcement of YouTube's subnet prefix (24 Feb)

Source: Hobbes' Internet Timeline, www.zakon.org/robert/internet/timeline/

Pakistan suffers a near complete Internet outage as a submarine cable becomes defective (Jun)

2005

Monday, 24 May 2010

Page 94: Websockets - OMG! Someone broke the internet!

Corus steel works, the Netherlands - ANP

Monday, 24 May 2010

Page 95: Websockets - OMG! Someone broke the internet!

Other stuff you will need to think about

Monday, 24 May 2010

Page 96: Websockets - OMG! Someone broke the internet!

Other stuff you will need to think about

Testing

Monday, 24 May 2010

Page 97: Websockets - OMG! Someone broke the internet!

Other stuff you will need to think about

Testing

Coupling

Monday, 24 May 2010

Page 98: Websockets - OMG! Someone broke the internet!

Other stuff you will need to think about

Testing

Coupling

Domain models

Monday, 24 May 2010

Page 99: Websockets - OMG! Someone broke the internet!

How do you normally test webapps?

...<div id=”algorithm”>

<span>var x = [crazy complex prime stuff]</span>

<form action=”/jobs/asd2b234c598/answer” method=”POST”><input type=”text” name=”answer” value=”” />

</form></div>...

Monday, 24 May 2010

Page 100: Websockets - OMG! Someone broke the internet!

How do you normally test webapps?

...<div id=”algorithm”>

<span>var x = [crazy complex prime stuff]</span>

<form action=”/jobs/asd2b234c598/answer” method=”POST”><input type=”text” name=”answer” value=”” />

</form></div>...

acceptance tests

integration tests

functional tests

unit tests

Monday, 24 May 2010

Page 101: Websockets - OMG! Someone broke the internet!

But now the logic is in both client and server

acceptance tests

integration tests

functional tests

unit tests

Monday, 24 May 2010

Page 102: Websockets - OMG! Someone broke the internet!

But now the logic is in both client and server

acceptance tests

integration tests

functional tests

unit tests

acceptance tests

integration tests

functional tests

unit tests

Monday, 24 May 2010

Page 103: Websockets - OMG! Someone broke the internet!

But now the logic is in both client and server

acceptance tests

integration tests

functional tests

unit tests

acceptance tests

integration tests

functional tests

unit tests

You don’t suck, so you are going to test both right?

Monday, 24 May 2010

Page 104: Websockets - OMG! Someone broke the internet!

And the asynchronous stuff? You’re pretty good at testing multi-threaded

code are you?

Monday, 24 May 2010

Page 105: Websockets - OMG! Someone broke the internet!

And the asynchronous stuff? You’re pretty good at testing multi-threaded

code are you?

Dan North and James’ first rule of concurrency

Monday, 24 May 2010

Page 106: Websockets - OMG! Someone broke the internet!

And the asynchronous stuff? You’re pretty good at testing multi-threaded

code are you?

Dan North and James’ first rule of concurrency

“Doug Lea does it better than you do...”

Monday, 24 May 2010

Page 107: Websockets - OMG! Someone broke the internet!

Recap

Monday, 24 May 2010

Page 108: Websockets - OMG! Someone broke the internet!

Websockets are really cool!

Recap

Monday, 24 May 2010

Page 109: Websockets - OMG! Someone broke the internet!

Websockets are really cool!And simple to use

Recap

Monday, 24 May 2010

Page 110: Websockets - OMG! Someone broke the internet!

Websockets are really cool!And simple to use

Recap

http://code.google.com/p/jquery-websocket/

http://jetty.codehaus.org/jetty/

http://www.google.com/chrome

Monday, 24 May 2010

Page 111: Websockets - OMG! Someone broke the internet!

Recap

Monday, 24 May 2010

Page 112: Websockets - OMG! Someone broke the internet!

You can implement some really exciting applications with them

Recap

Monday, 24 May 2010

Page 113: Websockets - OMG! Someone broke the internet!

You can implement some really exciting applications with them

They are particularly well-suited to low-latency stuff

Trading applications for example

Recap

Monday, 24 May 2010

Page 114: Websockets - OMG! Someone broke the internet!

Recap

Monday, 24 May 2010

Page 115: Websockets - OMG! Someone broke the internet!

Recap

But you won’t be able to take advantage of the stuff that makes the internet scale or interoperate

You will have to learn how to do that yourself

Monday, 24 May 2010

Page 116: Websockets - OMG! Someone broke the internet!

Ps we-run-any-code.com is coming...

Monday, 24 May 2010

Page 117: Websockets - OMG! Someone broke the internet!

Welcome back James

SKYNET is active

The current grid size is:

What code would you like to run?

22,107,123

...

>>

>>

>>

>>

Monday, 24 May 2010

Page 119: Websockets - OMG! Someone broke the internet!

Monday, 24 May 2010

Page 120: Websockets - OMG! Someone broke the internet!

A traditional implementation...

we-run-any-code.com

Monday, 24 May 2010

Page 121: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

Monday, 24 May 2010

Page 122: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

classic HTTP request-response

Monday, 24 May 2010

Page 123: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

classic HTTP request-response

Monday, 24 May 2010

Page 124: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

Monday, 24 May 2010

Page 125: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

Monday, 24 May 2010

Page 126: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

Monday, 24 May 2010

Page 127: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /index HTTP/1.1Host: we-run-any-code.com

Monday, 24 May 2010

Page 128: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /index HTTP/1.1Host: we-run-any-code.com

HTTP/1.1 200 OK

<html>...

<a rel=”nextjob” href=”/nextjob” />...

</html>

Monday, 24 May 2010

Page 129: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

Monday, 24 May 2010

Page 130: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /nextjob HTTP/1.1Host: we-run-any-code.com

Monday, 24 May 2010

Page 131: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /nextjob HTTP/1.1Host: we-run-any-code.com HTTP/1.1 303 See Other

Location: /jobs/asd2b234c598

Monday, 24 May 2010

Page 132: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /nextjob HTTP/1.1Host: we-run-any-code.com HTTP/1.1 303 See Other

Location: /jobs/asd2b234c598

GET /jobs/asd2b234c598 HTTP/1.1Host: we-run-any-code.com

Monday, 24 May 2010

Page 133: Websockets - OMG! Someone broke the internet!

Traditional we-run-any-code.comInteractions on the World Wide Web

GET /nextjob HTTP/1.1Host: we-run-any-code.com HTTP/1.1 303 See Other

Location: /jobs/asd2b234c598

...<div id=”algorithm”>

<span>var x = [crazy complex prime stuff]</span>

<form action=”/jobs/asd2b234c598/answer” method=”POST”><input type=”text” name=”answer” value=”” />

</form></div>...

GET /jobs/asd2b234c598 HTTP/1.1Host: we-run-any-code.com

HTTP/1.1 200 OK

Monday, 24 May 2010

Page 134: Websockets - OMG! Someone broke the internet!

What did we just see?

HTTP verbs and status codes

Addressable resources

HATEOAS

This is how the internet has been able to grow to, umm, internet-scale...

Monday, 24 May 2010

Page 135: Websockets - OMG! Someone broke the internet!

Closed set of operations, well-understood semantics

GET <resource-name> HTTP/1.1

PUT <resource-name> HTTP/1.1

POST <resource-name> HTTP/1.1

DELETE <resource-name> HTTP/1.1

OPTIONS <resource-name> HTTP/1.1

HEAD <resource-name> HTTP/1.1

Monday, 24 May 2010

Page 136: Websockets - OMG! Someone broke the internet!

Enables you to go from this:

Monday, 24 May 2010

Page 137: Websockets - OMG! Someone broke the internet!

To this

Monday, 24 May 2010

Page 138: Websockets - OMG! Someone broke the internet!

Representations of resources

Addressable

self-contained

(there’s this thing with media types, but we won’t go into that)

Monday, 24 May 2010

Page 139: Websockets - OMG! Someone broke the internet!

Representations of resources

...<div id=”algorithm”>

<span>var x = [crazy complex prime stuff]</span>

<form action=”/jobs/asd2b234c598/answer” method=”POST”><input type=”text” name=”answer” value=”” />

</form></div>...

Addressable

self-contained

(there’s this thing with media types, but we won’t go into that)

Monday, 24 May 2010

Page 140: Websockets - OMG! Someone broke the internet!

Representations of resources

...<div id=”algorithm”>

<span>var x = [crazy complex prime stuff]</span>

<form action=”/jobs/asd2b234c598/answer” method=”POST”><input type=”text” name=”answer” value=”” />

</form></div>...

HTTP/1.1 303 See OtherLocation: /jobs/asd2b234c598 Addressable

self-contained

(there’s this thing with media types, but we won’t go into that)

Monday, 24 May 2010

Page 141: Websockets - OMG! Someone broke the internet!

Hypermedia As The Engine Of Application State

<html>...

<a rel=”nextjob” href=”/nextjob” />...

</html>

Monday, 24 May 2010

Page 142: Websockets - OMG! Someone broke the internet!

Hypermedia As The Engine Of Application State

<html>...

<a rel=”nextjob” href=”/nextjob” />...

</html>

Starting Grid

GET Finding job

Running jobSubmitting answer

GET

GET

POST

Monday, 24 May 2010