Hi all,
In the main thread, I can spin the loop with the not recommended nsiThread
however I don’t need this. I need to spin the loop in a ChromeWorker. I have dispatched an async method and want to wait for it to complete. I know Task.jsm is a solution but I can’t do that without reworking this chunk of code.
Is there anyway to spin the event loop?
I tried this and it obviously didn’t wok, as it was in the while loop forever:
var lang = fetchFilestoreEntry({ mainkey:'prefs', key:'default_tesseract_lang' }); // <<<<<<< this call is async
var st = Date.now();
var i = 0;
while (!gFilestoreDefault.prefs.quick_save_dir) {
i++;
}
var end = Date.now();
console.log('prefs__quick_save_dir: took this long to get quick save dir:', (end - st), 'ms', 'ticks:', i);
This would get stuck in the while loop forever.