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 warehou...
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
Our Journey from in-House CD System to Open Source
ffjlabo
0
100
EitherT_with_Future
aoiroaoino
0
350
[RSJ24] Object Retrieval in Large-Scale Indoor Environments Using Dense Text with a Multi-Modal Large Language Model
keio_smilab
PRO
0
220
標準最高!標準はださくないぞ! at fukuoka.ts #1
yoiwamoto
0
150
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
9.3k
エンジニア採用を起点に取り組む組織の改善活動と課題、中長期のタスク管理/ #HRmethod
nishiuma
4
3.3k
AWS版GitHub?Amazon CodeCatalystの全体像をまとめてみた
oshanqq
1
3.2k
Practical GenAI with Go - Elastic and Golang Sydney
adriancole
0
130
バックログを導入し やっぱやめた話
ota42y
0
170
セキュリティ監視の内製化 効率とリスク
mixi_engineers
PRO
4
630
Estrategias de escalabilidade para projetos web
jessilyneh
1
140
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
0
3.1k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
340
39k
Visualization
eitanlees
142
15k
A Tale of Four Properties
chriscoyier
155
22k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
165
48k
Scaling GitHub
holman
458
140k
Done Done
chrislema
180
16k
Designing for humans not robots
tammielis
248
25k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
38
9.1k
Teambox: Starting and Learning
jrom
131
8.7k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
How to train your dragon (web standard)
notwaldorf
85
5.6k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
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