summaryrefslogtreecommitdiffstats
path: root/talks/cowboy-websocket/cowboy-websocket.html
blob: a6d73d1e4a7a01d132c607c75d69a336ead043d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Cowboy and Websocket</title>
<!-- metadata -->
<meta charset="utf8" />
<meta name="generator" content="S5" />
<meta name="version" content="S5 1.1" />
<meta name="presdate" content="20130209" />
<meta name="author" content="Loïc Hoguin" />
<meta name="company" content="Nine Nines" />
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="visible" />
<!-- style sheet links -->
<link rel="stylesheet" href="ui/default/slides.css" type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
<!-- S5 JS -->
<script src="ui/default/slides.js" type="text/javascript"></script>
</head>
<body>

<div class="layout">
<div id="controls"><!-- DO NOT EDIT --></div>
<div id="currentSlide"><!-- DO NOT EDIT --></div>
<div id="header">
	<div id="sub_header"></div>
	<div id="logo"><img src="ui/img/logo.svg"/></div>
</div>
<div id="footer">
<div id="footer_shadow"></div>
<h1>ErlangDC 2013</h1>
<h2>Cowboy and Websocket, Nine Nines</h2>
</div>

</div>


<div class="presentation">

<div class="slide">
<h1>Cowboy and Websockets</h1>
<h2>Theory and practice of building a webchat with Cowboy</h2>
<h3>Loïc Hoguin - @lhoguin</h3>
<h4>Erlang Cowboy and Nine Nines Founder</h4>
</div>


<div class="slide">
<h1>Background</h1>
</div>


<div class="slide">
<h1>Cowboy</h1>
<ul>
<li>Nearing release of version 0.8</li>
<li>100% Websocket standard compliant</li>
<li>Tested with &gt; 1 million Websocket connections</li>
<li>Now with a user guide!</li>
</ul>
</div>


<div class="slide">
<h1>Websocket</h1>
<ul>
<li>RFC 6455 The Websocket Protocol</li>
<li>HTTP Upgrade</li>
<li>Two-way connection between the client and the server</li>
<li>Text and binary</li>
</ul>
</div>


<div class="slide">
<h1>Theory</h1>
</div>


<div class="slide">
<h1>Webchat architecture</h1>
<ul>
<li>Users</li>
<li>One or more room</li>
<li>One or more users per room</li>
<li>Messages sent to one room broadcasted to all members</li>
</ul>
</div>


<div class="slide">
<h1>Practice</h1>
<ul>
<li>This is gonna be LEGEN-- wait for it!</li>
</ul>
</div>


<div class="slide">
<h1>High five!</h1>
<ul>
<li>... DARY!</li>
</ul>
</div>


<div class="slide">
<h1>More theory</h1>
</div>


<div class="slide">
<h1>Many connections per user</h1>
<ul>
<li>User session processes buffer messages</li>
<li>User sends messages to rooms</li>
<li>Room broadcasts to session processes</li>
<li>Session processes broadcast to connections</li>
</ul>
</div>


<div class="slide">
<h1>Handle disconnects</h1>
<ul>
<li>Messages get tagged with an auto-incremented id</li>
<li>Client sends last known eid on connect</li>
<li>Server atomically replies with all messages &gt; eid</li>
<li>Connection continues as before</li>
</ul>
</div>


<div class="slide">
<h1>Thanks!</h1>
<ul>
<li>http://ninenines.eu</li>
<li>https://github.com/extend/cowboy</li>
<li>#ninenines on Freenode</li>
<li>@lhoguin on Twitter</li>
</ul>
</div>


<div class="slide">
<h1>Questions?</h1>
</div>


</div>

</body>
</html>