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
Concurrent SSJS on the JVM
Search
Philipp Naderer
February 19, 2014
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
84
The Making of a Coronavirus Dashboard
botic
0
150
Seestadt.bot @ Demo Night: Chatbots & Voice Apps
botic
0
140
Seestadt come2gether – StadtKatalog
botic
0
79
Location-aware Documents
botic
0
130
Chatbots @ HacksHackers Munich
botic
0
110
Chatbots @ Mediencamp Vienna
botic
0
190
GEN Editors Lab Munich – BotOx / Team ORF
botic
0
320
Final Master Thesis Presentation
botic
0
200
Other Decks in Programming
See All in Programming
contenteditable と日本語入力に向き合う
colorful12
0
190
golang-bob.pdf
iwatsukayura
0
130
sbt 2.0: takeoff
eed3si9n
0
150
Agents on Rails - Rails at Scale 2026
irinanazarova
0
540
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
The Rails Doctrine Decade
koic
2
570
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
260
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
330
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
1
110
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
For a Future-Friendly Web
brad_frost
184
10k
Why Our Code Smells
bkeepers
PRO
340
58k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
560
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Git: the NoSQL Database
bkeepers
PRO
433
67k
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