How to execute a method on other thread and get result to Javascript?
Im using this example in mind (i don't know if it is the best example):
https://chromium.googlesource.com/chrom ... ing-a-task
I want call C++ function from javascript like im already do here:
https://github.com/paulo-coutinho/cef-s ... me.vue#L94
But i want now execute a long time function without block browser and return the result/callback to javascript function. Something like this:
- Code: Select all
var result = MyApp.longTask("my param 1", "my param 2");
console.log(result);
// or
MyApp.longTask("my param 1", "my param 2").then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});
Can anyone help me?
Thanks.