Yes your suggestion is OK in theory but in practice, Nashorn is too slow without Warmup. I can say Nashorn is 5x to 10x slower than embedded webkit to run script.
2015-12-08 15:09 GMT+02:00 Benjamin Gudehus <[email protected]>: > The JavaFX API offers Worker class for long running tasks. > > If you want to execute JavaScript code without DOM and JavaFX you can use > the Nashorn JS Virtual machine, which is included in Java 8. I guess the > Nashorn documentation also has examples how it's used with the Java > scripting API. > On Dec 8, 2015 1:50 PM, "Rahman USTA" <[email protected]> wrote: > >> I'm really enjoying developing apps in JavaFX, but I think there is a >> limitation point; >> >> When we think HTML5, there is WebWorker to run long-running tasks in >> another process. So, we know WebWorker has no DOM access, it is generally >> used computational needs. >> >> Ok, We can run long-running tasks in JavaFX with many threading services, >> but there is one exception; >> >> There are a lot of JavaScript libraries, and executing them in WebView >> needs JavaFX Application Thread. But, what if your JS code takes long time >> to execute ? Your UI will hang. Is it required to execute JS code in >> WebView if it is not accessing DOM API? >> >> Thanks. >> >> -- >> Rahman USTA >> Istanbul JUG >> https://github.com/rahmanusta <http://www.kodcu.com/> >> > -- Rahman USTA Istanbul JUG https://github.com/rahmanusta <http://www.kodcu.com/>
