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
Concurrent SSJS on the JVM
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Philipp Naderer
February 19, 2014
Programming
110
0
Share
Concurrent SSJS on the JVM
Presentation from the Fronteers Jam Session 2012 in Amsterdam.
Philipp Naderer
February 19, 2014
More Decks by Philipp Naderer
See All by Philipp Naderer
Im Maschinenraum der Corona-Dashboards
botic
0
76
The Making of a Coronavirus Dashboard
botic
0
150
Seestadt.bot @ Demo Night: Chatbots & Voice Apps
botic
0
130
Seestadt come2gether – StadtKatalog
botic
0
75
Location-aware Documents
botic
0
110
Chatbots @ HacksHackers Munich
botic
0
99
Chatbots @ Mediencamp Vienna
botic
0
180
GEN Editors Lab Munich – BotOx / Team ORF
botic
0
300
Final Master Thesis Presentation
botic
0
190
Other Decks in Programming
See All in Programming
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.8k
実用!Hono RPC2026
yodaka
2
310
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
630
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
1.2k
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
200
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.5k
ハーネスエンジニアリングとは?
kinopeee
13
7k
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
180
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
340
【ディップ|26年新卒研修資料】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
150
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
130
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Balancing Empowerment & Direction
lara
6
1.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Statistics for Hackers
jakevdp
799
230k
Evolving SEO for Evolving Search Engines
ryanjones
0
190
Mobile First: as difficult as doing things right
swwweet
225
10k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Prompt Engineering for Job Search
mfonobong
0
300
My Coaching Mixtape
mlcsv
0
120
30 Presentation Tips
portentint
PRO
1
290
Are puppies a ranking factor?
jonoalderson
1
3.4k
Transcript
Concurrent SSJS on the JVM Philipp Naderer / @botic
None
None
RingoJS • JavaScript on the JVM • Based on Mozilla
Rhino • Part of Java SE 6 and Java SE 7 • Successor / Rewrite of Helma • 14 years of SSJS experience!
Features • CommonJS modules & packages • Full access to
Java libraries • ECMAScript 5 and JS 1.8 support • Lots of „ringo/“ modules • dates, http, concurrency, logging, subprocesses, jsgi, command line, ...
Debugger
Threads and SSJS? • Ringo‘s concept: Workers • Implicit multithreaded
code • You can use an EventLoop • No shared global object* • Singletons instead of shared data
myWebApp Module myWebApp Module blocking running running Event Loop
webserver.js var response = require("ringo/jsgi/response"); var {Application} = require("stick"); !
var app = exports.app = new Application(); ! // Configure stick middlewares app.configure("notfound", "route"); ! app.get("/", function(request) { return response.html("<h1>Servas Amsterdam!</h1>"); }); ! if (require.main == module) { require("ringo/httpserver").main(module.id); }
webserver.js serving 10.000 HTTP requests
„Ringo Workers“ • Look like Web Workers in Browsers •
No JSON serialization needed = faster! • Send a message with postMessage(e) • React on message with onMessage(e) • Return the result to the caller with postMessage(e)
fibobuster.js 1. var {Worker} = require("ringo/worker"); 2. 3. // Create
50 Workers = 50 Threads 4. for (var i = 50; i < 100; i++) { 5. var w = new Worker(module.resolve("./fibonacci")); 6. 7. // Callback for the output 8. w.onmessage = function(returnObj) { 9. console.log("Result: " + returnObj.data.result); 10. } 11. 12. // Start with the calculation 13. w.postMessage(i); 14. }
fibonacci.js function onmessage(message) { var limit = message.data; ! console.log("Fibonacci
#" + limit); ! /* Calculate the fibonacci number */ var a = ..., b = ..., c = ...; for (...) { ... } ! message.source.postMessage({ result: c }); }
RingoJS infos • ringojs.org – basic information • github.com/ringojs –
source + examples • @ringojs – official account • @hannesw – Hannes‘ account • IRC: irc.freenode.net #ringojs
None