Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Using slanger and websockets to power a warehouse backend
Search
schokomarie
August 18, 2012
Technology
1
470
Using slanger and websockets to power a warehouse backend
Websockets are fun for chats and online games. But are there serious uses? ...
schokomarie
August 18, 2012
Tweet
Share
Other Decks in Technology
See All in Technology
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
560
チームでロジカルシンキングに改めて向き合っている話 〜学習環境と実践⽅法〜
sansantech
PRO
2
2.2k
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.7k
家族アルバム みてねにおけるGrafana活用術 / Grafana Meetup Japan Vol.1 LT
isaoshimizu
1
640
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
170
JAWS-UG Bedrock Claude Night
yamahiro
3
580
生産性向上チームの紹介
cybozuinsideout
PRO
1
870
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
510
コンテナセキュリティの基本と脅威への対策
kyohmizu
3
760
Meta Quest 3 で動く桜マシマシ WebXR アプリを IBM Cloud Code Engine と Babylon.js で作った話
1ftseabass
PRO
0
120
私が trocco を推す理由
__allllllllez__
1
220
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
380
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
Product Roadmaps are Hard
iamctodd
44
9.7k
How GitHub (no longer) Works
holman
304
140k
Gamification - CAS2011
davidbonilla
76
4.6k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
The Power of CSS Pseudo Elements
geoffreycrofte
60
5k
Into the Great Unknown - MozCon
thekraken
10
990
Mobile First: as difficult as doing things right
swwweet
216
8.6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
YesSQL, Process and Tooling at Scale
rocio
164
13k
Transcript
$whoami Samstag, 18. August 2012
Using slanger and websockets to power a warehouse backend Samstag,
18. August 2012
© NBC Samstag, 18. August 2012
What? •a web application for a printing company to simplify
the packing process Samstag, 18. August 2012
What? •the system runs on a touchscreen desktop in kiosk
mode and needs to be synchronized in realtime Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
websockets •native browser support •real bi-directional connection •less overhead than
ajax-requests •easier to handle than long-polling Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
protocol •roll your own •pre-made Samstag, 18. August 2012
pusher •a webservice sending realtime messages between clients •german Datenschutz:
can not send german client data to an us-based service Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
slanger •open source websocket server •runs on a local machine
•compatible with pusher‘s API •thus compatible with pusher. js Samstag, 18. August 2012
architecture •Padrino backend •slanger •html-5 client Samstag, 18. August 2012
architecture •application handles entity changes and sends events to slanger
•client subscribes to slanger events •slanger dispatches events to the client •client uses event data to render mustache templates Samstag, 18. August 2012
Samstag, 18. August 2012
Samstag, 18. August 2012
advantages •very simple client side js code •almost no logic
in the client •server side business logic Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
handle with care •Never mix client-side events with server-side events
•keep all business logic on the server •Minimize assumptions about event behaviour in the client Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
© NBC Samstag, 18. August 2012
pitfalls •correct redis version (≥2.4.14) •slanger is an app, not
a lib Samstag, 18. August 2012
stuff • https://github.com/stevegraham/slanger • https://github.com/defunkt/resque • http://redis.io/ • https://github.com/padrino/padrino-framework •
http://handlebarsjs.com/ • http://twitter.github.com/bootstrap/ • http://www.websocket.org/quantum.html Samstag, 18. August 2012
© NBC Samstag, 18. August 2012