Created
January 18, 2019 22:06
-
-
Save eleinadani/5a8805a2ee3a12526d43f709cf292460 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let w = new Worker(` | |
const JavaClass = Java.type('my.very.important.JavaClass'); | |
const { parentPort } = require('worker_threads'); | |
parentPort.postMessage(JavaClass.someVeryLongCall()); | |
`, {eval:true}); | |
w.on('message', (m) => { | |
console.log('Got data from Java, via worker thread:' + m); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment