Closed MarkusJx closed 1 year ago
Allows proxies to be used in a synchronous context:
java.config.runEventLoopWhenInterfaceProxyIsActive = true; const proxy = java.newProxy('java.util.function.Function', { apply: (arg: string): string => arg.toUpperCase(); }); const JavaString = java.importClass('java.lang.String'); const str = new JString('hello'); const res = str.transformSync(proxy); // prints 'HELLO' console.log(res);
This is done by forcing the event loop to run while waiting for the java process to return a result.
Allows proxies to be used in a synchronous context:
This is done by forcing the event loop to run while waiting for the java process to return a result.