Hey i was wondering how i would go about dynamically call a function like the following:
async function xxx(number) {
if(number == 10) return
xxx(number + 1);
}
My goal is instead of having it call 1 at a time i want it to call 3/4 and run side by side(if 1 thread has checked number 2 others wont check), the number of threads depending on the needed outcome. This is a basic version but good example of what i need done
You can use Web worker here to perform a task from another thread. Web worker gives that ability to run a task in background without affecting the main thread, Please check this link for more info using web worker
I will also recommend you to check the difference between Service worker and Web worker so that you can analyse what suits the best for the use case, please check this link