We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
J2V8 is severely outdated and is no longer maintained. The unofficial v6.2.0 build doesn't support Node.js which, if I understood correctly, is needed for viz.js but already provides a significant perfomance improvement. The tradeoff would be losing Mac support but at this point wouldn't GraalJS + GraalVM provide a similar perfomance compared to the 2016 verison of V8?
The text was updated successfully, but these errors were encountered:
Here's an implementation I ended up using to integrate Javet
class V8JavascriptEngine() extends AbstractJavascriptEngine { val LOG = LoggerFactory.getLogger(classOf[V8JavascriptEngine]) val v8Runtime: V8Runtime = V8Host.getV8Instance().createV8Runtime() LOG.info("Starting V8 runtime...") LOG.info("Started V8 runtime. Initializing javascript...") val resultHandler = new ResultHandler val javetStandardConsoleInterceptor = new JavetStandardConsoleInterceptor(v8Runtime) javetStandardConsoleInterceptor.register(v8Runtime.getGlobalObject) class ResultHandlerInterceptor(resultHandler: ResultHandler){ @V8Function def result(s: String) = resultHandler.setResult(s) @V8Function def error(s: String) = resultHandler.setError(s) @V8Function def log(s: String) = resultHandler.log(s) } val v8ValueObject = v8Runtime.createV8ValueObject v8Runtime.getGlobalObject.set("resultHandlerInterceptor", v8ValueObject) v8ValueObject.bind(new ResultHandlerInterceptor(resultHandler)) v8Runtime.getExecutor( "var result = resultHandlerInterceptor.result; " + "var error = resultHandlerInterceptor.error; " + "var log = resultHandlerInterceptor.log; " ).execute() LOG.info("Initialized javascript.") override protected def execute(js: String): String = { v8Runtime.getExecutor(js).execute() resultHandler.waitFor } override def close(): Unit = v8Runtime.close() }
Sorry, something went wrong.
No branches or pull requests
J2V8 is severely outdated and is no longer maintained. The unofficial v6.2.0 build doesn't support Node.js which, if I understood correctly, is needed for viz.js but already provides a significant perfomance improvement. The tradeoff would be losing Mac support but at this point wouldn't GraalJS + GraalVM provide a similar perfomance compared to the 2016 verison of V8?
The text was updated successfully, but these errors were encountered: