Click here to Skip to main content
15,885,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a native application in Java and a Chrome extension. A round trip of my application is like this:

1- JavaScript initiates a call to Native App.
2- Native app reads the stream and does some calculations.
3- Native app needs to call a JS function and needs its result for some further calculations. If the native app calls JS (by sending a message via the extension), then what happens? How can I get the result back?

I know that I call call a callback by JS later when the call is done, but how can I wait here on Java side to get the result back? Previously I had an Applet and used to use FutureTask object, but do you think it would be here also possible to create a FutureTask?

Thank you very much.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900