Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
orange — Client side concurrency made simple
Search
Florian Plank
October 17, 2013
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
orange — Client side concurrency made simple
Florian Plank
October 17, 2013
More Decks by Florian Plank
See All by Florian Plank
Ready, set, immersion!
polarblau
0
230
Prototyping all the things
polarblau
2
200
CoffeeScript vs. ECMAScript 6
polarblau
5
3.7k
Design for a complex Reality — Siili Breakfast Edition
polarblau
0
180
Enabling Design for a Complex Reality
polarblau
2
170
A primer on Content Security Policy
polarblau
1
490
Rails and the future of the open web
polarblau
3
160
Brief Ruby/Ruby on Rails intro
polarblau
3
230
Ruby Idioms
polarblau
3
630
Other Decks in Programming
See All in Programming
R8 の設定見直しでアプリサイズ削減
andpad
0
220
Simple Storage Service(S3) is not simple
iwatsukayura
0
310
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.3k
AI-Powered Domain-Driven Design
ziobrando
0
230
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
190
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
140
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
34k
Event is what happens
moro
2
1.2k
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
1k
sbt 2.0: takeoff
eed3si9n
0
170
オーケストレーション記述言語 Katari
yukikurage
0
180
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
640
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
HDC tutorial
michielstock
2
970
How to Ace a Technical Interview
jacobian
280
24k
A designer walks into a library…
pauljervisheath
211
25k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
How STYLIGHT went responsive
nonsquared
100
6.3k
Fireside Chat
paigeccino
43
4.1k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
450
Music & Morning Musume
bryan
48
7.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Transcript
orange — Client side concurrency made simple
rubysauna.org
heartrate.js
None
None
None
None
Concurrency
A B C
A B C
A B C
Concurrency is hard
A B C
Concurrency
Barber z z
Barber Customer z z Sleeping?
Barber Customer
Barber Customer Working?
Barber Customer
Barber
Barber Customer
Barber
Barber Customer ?
Barber Customer Crap.
Barber
Barber Customer
Barber z z Crap.
Concurrency in the browser
JavaScript and the golden thread
None
None
None
foo() 10ms 20ms 30ms 40ms click handled click fired setInterval
(10ms)
None
Synchronous —vs— Asynchronous
WebWorkers
JavaScript Thread Worker
Worker JavaScript Thread
Worker Worker JavaScript Thread
Dedicated, Shared & Inline Workers
None
orange
The queue
Define a worker
# workers/sum.coffee importScripts 'orange/worker.js' perform (data)-> data.numbers.reduce (a, b)-> a
+ b
# workers/sum.coffee importScripts 'orange/worker.js' perform (data)-> data.numbers.reduce (a, b)-> a
+ b
Create a new job
job = new Orange.Job('sum', numbers: [1..100])
job = new Orange.Job('sum', numbers: [1..100]) job.on 'success', (response) ->
console.log('Sum', response) job.perform()
Events
job.on 'success', (response)-> job.on 'complete', -> job.on 'error', (error)-> job.on
'failure', (error)->
Logging
# workers/sum.coffee importScripts 'orange/worker.js' perform (data)-> log 'The background worker
Gotham deserves ...' data.numbers.reduce (a, b) ->a + b
Batches
batch = new Orange.Batch
batch = new Orange.Batch job = new Orange.Job('sum', [1..100]) batch.push
job batch.perform()
batch = new Orange.Batch [job1, job2, job3]
batch.on 'complete', (jobs) -> batch.on 'job:success', (job) -> batch.on 'job:complete',
(job)-> batch.on 'job:error', (job) -> batch.on 'job:failure', (job) ->
job.getResponse() job.getLastError()
Configuration
Orange.Config.set maxWorkerPoolSize: 4 maxRetries : 3 workersPath : '/lib/workers/'
Retry mechanism and exponential back–off
Error handling
job.on 'error', (error)-> throw error BatchStateTransitionError JobStateTransitionError ResponderNotFoundError …
None
Roadmap >0.2.0
Customized Worker Shim Test coverage Data serialization Benchmarking
Forward arbitrary method calls to worker? Custom events? Instrumentation? Inline
Workers? Helper modules?
Kiitos!
@polarblau