summaryrefslogblamecommitdiffstats
path: root/talks/cowboy-websocket/cowboy-websocket.html
blob: a6d73d1e4a7a01d132c607c75d69a336ead043d8 (plain) (tree)






























































































































































                                                                                                         
<!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>