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
220
Ruby Idioms
polarblau
3
630
Other Decks in Programming
See All in Programming
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
3.4k
Jetpack Compose メカニズム
skydoves
0
470
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
290
すこし踏み込む CancellationToken
htkym
2
1k
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
360
一人だけ、Kiroが静止する日
hideg
0
130
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
新卒PdEのリアル
ryu1013
1
510
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
190
AWSに止められる覚悟してますか?
morizo_1984
1
270
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.5k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
580
RailsConf 2023
tenderlove
30
1.6k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
420
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
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