Async Python and Web Sockets
Anton Caceres
PYCON GERMANY 2016
PYCON WEB ❤
LAW OFTHE INSTRUMENT
HTTP,
Me want this!!111
THE IDEA
+STYLES, IMAGES,APP SERVER
ICONS SPRITES
.flags-italy {
height: 135px;
background-position: -5px -143px;
}
AJAX
AJAX
LONG POLLING
WEB SOCKETS
USING WEBSOCKETS
by Stanislav Dzhus
PERFORMANCE
PITFALLS
• No caching
• No statuses
• No error handling
• Idempotent actions
• Delivery not
guaranteed
• Connection control
needed
USE CASES
• Tracking systems
• Monitoring
• Logging
• Multiplayer games
• Collaborative editing
CLIENT EXAMPLE
VANILLA JS
CLIENT EXAMPLE
VANILLA JS
BACKENDTOOLS
What can we use in Python
TORNADO
TORNADO
DEMO
DJANGO (CHANNELS)
DJANGO CHANNELS
BONUS:WEBSOCKETS
WEBSOCKETS
Want some remoteTornado tasks?
- talk to me, anton@tech-5.de
An agency that actually works ©
THANKYOU!
CREDITS
• Jasdeep Jaitla - WebSockets vs REST: Understanding the
Difference, https://www.pubnub.com/blog/2015-01-05-
websockets-vs-rest-api-understanding-the-difference/
• Eric Chen - Load Balancing WebSockets: https://
devcentral.f5.com/articles/load-balancing-websockets
• SF Python January 2015 - WebSockets in Python by Matt
Makai: https://www.youtube.com/watch?v=L5YQbNrFfyw

Anton Caceres "Async Python and Web Sockets"