TheMysteriousVincent Posted March 24, 2020 Author Posted March 24, 2020 (edited) Hey, @veers! Take a look at the single source files I uploaded recently: https://github.com/eisengrind/v-rpc/releases/tag/js-v1.0.1 If you are not using npm at all then you also can use these single source files provided there like this: var v = require('vrpc-client.min.js'); v.vrpc.callServerAsync('ping', true); Otherwise you would had to copy the npm package files. Edited March 24, 2020 by TheMysteriousVincent
veers Posted March 25, 2020 Posted March 25, 2020 I got it to work. Thanks. Is there any way to force the script to wait for the promise to get the value? 1
TheMysteriousVincent Posted March 26, 2020 Author Posted March 26, 2020 (edited) No. And that is for a good reason: Since JavaScript is a programming language that runs in only one thread - something like waiting for a result and thus blocking other code executions would be fatal. That is when the Promise comes in handy, because a Promise does not block nor "wait" in the main thread for a result to return, so that other code executions can be continued. Its a bit more complicated than the short summary above. If you are interested, here is a good explanation on that: https://developers.google.com/web/fundamentals/primers/promises Edited March 26, 2020 by TheMysteriousVincent
xshady Posted June 12, 2020 Posted June 12, 2020 wow, thanks for this very cool resource! but.. why didn't you add methods for calling on one side? like: vrpc.callSync/vrpc.callAsync
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now